Val Town Code SearchReturn to Val Town

API Access

You can access search results via JSON API by adding format=json to your query:

https://codesearch.val.run/$%7Bsuccess?q=function&page=1702&format=json

For typeahead suggestions, use the /typeahead endpoint:

https://codesearch.val.run/typeahead?q=function

Returns an array of strings in format "username" or "username/projectName"

Found 19855 results for "function"(3395ms)

uptimemain.tsx1 match

@wilgโ€ขUpdated 11 months ago
6);
7
8export async function uptimeCheck(url: string) {
9 let ok = true;
10 let reason: string;

aiHonoHtmxAlpineStreamingExamplemain.tsx3 matches

@yawnxyzโ€ขUpdated 11 months ago
18
19
20// in this example we use a custom function instead of htmx's custom sse extension, since it never closes!
21function getResponse({prompt}) {
22 const outputDiv = document.getElementById('output');
23 prompt = prompt ||document.getElementById('prompt').value;
97 <div id="output"></div>
98 <script>
99 // instead of htmx sse we pass it a custom function
100 ${getResponse}
101 </script>

isMyWebsiteDownmain.tsx1 match

@healeycodesโ€ขUpdated 11 months ago
6);
7
8export async function uptimeCheck(url: string) {
9 let ok = true;
10 let reason: string;

uptimemain.tsx1 match

@devinmcgloinโ€ขUpdated 11 months ago
6);
7
8export async function uptimeCheck(url: string) {
9 let ok = true;
10 let reason: string;

twitterAlertmain.tsx1 match

@sumukhโ€ขUpdated 11 months ago
4const query = "\"val.town\" OR \"val town\" -_ValTown_ -is:retweet";
5
6export async function twitterAlert({ lastRunAt }: Interval) {
7 const results = await twitterSearch({
8 query,

uptimemain.tsx1 match

@sumukhโ€ขUpdated 11 months ago
6);
7
8export async function uptimeCheck(url: string) {
9 let ok = true;
10 let reason: string;

sparklineSVGReactmain.tsx2 matches

@stevekrouseโ€ขUpdated 11 months ago
1/** @jsxImportSource https://esm.sh/react */
2
3export function SparklineSVG({ strokeWidth, data, height, width, fill, stroke }) {
4 const padding = 2;
5 const xMargin = 25;
14 const yMid = (yMin + yMax) / 2;
15
16 // Scaling functions
17 const xScale = x => ((x - xMin) / (xMax - xMin)) * (width - 2 * padding) + padding + xMargin;
18 const yScale = y => height - padding - ((y - yMin) / (yMax - yMin)) * (height - 2 * padding);

plotLinkeDOMSRRExamplemain.tsx1 match

@stevekrouseโ€ขUpdated 11 months ago
3import { parseHTML } from "npm:linkedom@0.15";
4
5export default async function() {
6 const document = parseHTML("<a>").document;
7 const chart = Plot.plot({

aiHonoHtmxAlpineStreamingExampleREADME.md1 match

@yawnxyzโ€ขUpdated 11 months ago
1This Frankenstein of an example shows how well Hono, htmx, and Alpine play together.
2- Hono serves the frameworks, API calls, and functions
3- htmx handles ajax requests, and can very powerfully request html and other content to swap out the front-end
4- alpine handles app-like reactivity without having to always resort to server round trips

generateFishmain.tsx1 match

@iamseeleyโ€ขUpdated 11 months ago
1export function generateFish() {
2 const fishEmojis = ['๐ŸŸ', '๐Ÿ ', '๐Ÿก', '๐Ÿฌ', '๐Ÿณ', '๐Ÿ‹', '๐Ÿ™', '๐Ÿฆ‘', '๐Ÿฆ', '๐Ÿฆž'];
3 let fish = '';

getFileEmail4 file matches

@shouserโ€ขUpdated 3 weeks ago
A helper function to build a file's email
tuna

tuna8 file matches

@jxnblkโ€ขUpdated 3 weeks ago
Simple functional CSS library for Val Town
lost1991
import { OpenAI } from "https://esm.town/v/std/openai"; export default async function(req: Request): Promise<Response> { if (req.method === "OPTIONS") { return new Response(null, { headers: { "Access-Control-Allow-Origin": "*",
webup
LangChain (https://langchain.com) Ambassador, KubeSphere (https://kubesphere.io) Ambassador, CNCF OpenFunction (https://openfunction.dev) TOC Member.