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/image-url.jpg%20%22Image%20title%22?q=function&page=2430&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 26879 results for "function"(2434ms)

btcPriceAlertmain.tsx1 match

@thejian•Updated 1 year ago
4import { currency } from "https://esm.town/v/stevekrouse/currency";
5
6export async function btcPriceAlert() {
7 const lastBtcPrice: number = await blob.getJSON("lastBtcPrice");
8 let btcPrice = await currency("usd", "btc");

staticChessREADME.md1 match

@wesleychiyoka•Updated 1 year ago
6Plain, brutalist, no bloat chess. Every page is only html and css. Every chess move is made by clicking a link. Send a link to your friend and they'll send you one back to make your move. No silly animations or slick interactivity to trip up your gameplay. When Google indexes this site will we successfully compute all possible chess moves?
7
8Functionality is quite limited, and things might be broken. Please let me know if you find bugs!
9
10Inspired by [this HN discussion](https://news.ycombinator.com/item?id=39456467) about sites that have all possible game states of tic-tac-toe.

staticChessREADME.md1 match

@rickygrassmuck•Updated 1 year ago
6Plain, brutalist, no bloat chess. Every page is only html and css. Every chess move is made by clicking a link. Send a link to your friend and they'll send you one back to make your move. No silly animations or slick interactivity to trip up your gameplay. When Google indexes this site will we successfully compute all possible chess moves?
7
8Functionality is quite limited, and things might be broken. Please let me know if you find bugs!
9
10Inspired by [this HN discussion](https://news.ycombinator.com/item?id=39456467) about sites that have all possible game states of tic-tac-toe.

tootLatestPostsmain.tsx1 match

@geraldo•Updated 1 year ago
2import { newRSSItems } from "https://esm.town/v/stevekrouse/newRSSItems?v=6";
3
4export async function tootLatestPosts({ lastRunAt }: Interval) {
5 return Promise.all(
6 (await newRSSItems({

importValInChromeConsolemain.tsx1 match

@stevekrouse•Updated 1 year ago
1console.log("This runs on import");
2
3export function test() {
4 console.log("This runs when test() is called");
5}

dudemain.tsx2 matches

@stevekrouse•Updated 1 year ago
6console.log(theString);
7theString = theString.replace(`'squint-cljs/core.js'`, `'npm:squint-cljs/core.js'`);
8const AsyncFunction = Object.getPrototypeOf(async function() {}).constructor;
9await new AsyncFunction(theString)();

squintmain.tsx2 matches

@borkdude•Updated 1 year ago
6 console.log(theString);
7 theString = theString.replace(`'squint-cljs/core.js'`, `'npm:squint-cljs/core.js'`);
8 const AsyncFunction = Object.getPrototypeOf(async function() {}).constructor;
9 await (new AsyncFunction(theString)());
10})();

limit_model_forkmain.tsx2 matches

@std•Updated 1 year ago
14});
15
16export default async function(req: Request): Promise<Response> {
17 // Ensure only allowed pathnames are used
18 const { pathname, search } = new URL(req.url);
61}
62
63async function limitFreeModel(req: Request, user: any) {
64 if (user.tier === "pro") return req.body;
65 const input = await req.json();

aqimain.tsx1 match

@geraldo•Updated 1 year ago
2import { easyAQI } from "https://esm.town/v/stevekrouse/easyAQI";
3
4export async function aqi(interval: Interval) {
5 const location = "barcelona"; // <-- change to place, city, or zip code
6 const data = await easyAQI({ location });

tinygoHttpExampleREADME.md1 match

@maxm•Updated 1 year ago
18const resp = await fetch("https://maxm-wasmblobhost.web.val.run/jpxqvyy5tphiwehzklmioklpkpz4gpzs.wasm");
19const handler = await wasmHandler(new Uint8Array(await resp.arrayBuffer()));
20export default async function(req: Request): Promise<Response> {
21 return handler(req);
22}

getFileEmail4 file matches

@shouser•Updated 1 month ago
A helper function to build a file's email
tuna

tuna8 file matches

@jxnblk•Updated 1 month 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.