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=2105&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 29303 results for "function"(8245ms)

valentinemain.tsx3 matches

@parths239•Updated 3 months ago
13];
14
15function App() {
16 const [noClicks, setNoClicks] = useState(0);
17 const [isValentine, setIsValentine] = useState(false);
98}
99
100function client() {
101 createRoot(document.getElementById("root")).render(<App />);
102}
103if (typeof document !== "undefined") { client(); }
104
105export default async function server(request: Request): Promise<Response> {
106 return new Response(
107 `

absoluteBoutiqueStoremain.tsx3 matches

@nickynole•Updated 3 months ago
116];
117
118function App() {
119 const [cart, setCart] = useState([]);
120 const [filter, setFilter] = useState("all");
430};
431
432function client() {
433 createRoot(document.getElementById("root")).render(<App />);
434}
435if (typeof document !== "undefined") { client(); }
436
437export default async function server(request: Request): Promise<Response> {
438 return new Response(
439 `

statusstatus3 matches

@nickynole•Updated 3 months ago
9const thisURL = parseProject(import.meta.url).links.self.project;
10
11function StatusRow({ rows }) {
12 return (
13 <div className="w-full flex flex-col space-y-2">
31}
32
33function StatusSection({ url, rows }) {
34 const sectionRows = rows.filter(row => row[0] === url);
35 const percentUp = Math.round((sectionRows.filter(row => row[1]).length / sectionRows.length) * 100);
47}
48
49export default async function(req: Request): Promise<Response> {
50 const { rows } = await sqlite.execute(
51 "select url, ok, duration, timestamp from uptime order by timestamp desc limit 200",

statussparklineSVG1 match

@nickynole•Updated 3 months ago
1/** @jsxImportSource https://esm.sh/react@18.2.0 */
2export function SparklineSVG({ strokeWidth = 2, data = [], fill = "none", stroke = "black" }) {
3 const padding = 2;
4 const xMargin = 25;

statusnotify1 match

@nickynole•Updated 3 months ago
4const thisURL = parseProject(import.meta.url).links.self.latest;
5
6export async function notify(message: string) {
7 await email({ subject: message, text: `Email sent from ${thisURL}` });
8}

statusmonitor1 match

@nickynole•Updated 3 months ago
7);
8
9export async function uptimeCheck(url: string, attempt = 1) {
10 let reason: string = "";
11 let status: number | null = null;

upstandingPurpleHeronmain.tsx3 matches

@nickynole•Updated 3 months ago
106];
107
108function App() {
109 const [cart, setCart] = useState([]);
110 const [filter, setFilter] = useState("all");
420};
421
422function client() {
423 createRoot(document.getElementById("root")).render(<App />);
424}
425if (typeof document !== "undefined") { client(); }
426
427export default async function server(request: Request): Promise<Response> {
428 return new Response(
429 `

funPurpleStingraymarvelousYellowDog1 match

@charmaine•Updated 3 months ago
1export default async function (req: Request): Promise<Response> {
2 return Response.json({ ok: true })
3}

brainrotdepsmain.tsx2 matches

@stainless_em•Updated 3 months ago
3const js = await memoizeByVersion(async () => {
4 const url =
5 "https://deno.bundlejs.com/?file&text=export%20%7Bdefault%20as%20toIt%7D%20from%20%22browser-readablestream-to-it%22;%0Aexport%20%7Bdefault%20as%20jsonpatch%7D%20from%20%22fast-json-patch@3.1.1%22;%0Aexport%20%7B%20TextLineStream%20%7D%20from%20%22https://esm.sh/jsr/@std/streams@1.0.9/text_line_stream%22;%0Aimport%20*%20as%20preact%20from%20%22preact@10%22;%0Aimport%20*%20as%20preactHooks%20from%20%22preact@10/hooks%22;%0Aimport%20%7Bjsx%20as%20jsx_,%20jsxs%20as%20jsxs_,%20Fragment%20as%20Fragment_%7D%20from%20%22preact@10/jsx-runtime%22;%0Aexport%20const%20React%20=%20%7B...preact,%20...preactHooks%7D%0Aexport%20let%20jsx%20=%20jsx_,%20jsxs%20=%20jsxs_,%20Fragment%20=%20Fragment_%0Aexport%20function%20setJsx(jsx_,%20jsxs_,%20Fragment_)%20%7B%0A%20%20jsx%20=%20jsx_,%20jsxs%20=%20jsxs_,%20Fragment%20=%20Fragment_%0A%7D";
6 return `/*\nbundled version of this:\n\`\`\`js\n${new URL(url).searchParams.get("text")}\n\`\`\`\n*/\n\n`
7 + await (await fetch(url)).text();
8}, import.meta.url);
9export default httpCache(async function(req: Request): Promise<Response> {
10 return new Response(
11 js,

memoizeByVersionmain.tsx4 matches

@stainless_em•Updated 3 months ago
7
8/**
9 * Memoize an async function's result using blob storage, keyed by the val's version
10 * @param fn The async function to memoize
11 * @param metaUrl The import.meta.url of the current val
12 * @returns The result of the memoized function
13 */
14export default async function memoizeByVersion<T>(
15 fn: () => Promise<T>,
16 metaUrl: string,
tuna

tuna9 file matches

@jxnblk•Updated 1 day ago
Simple functional CSS library for Val Town

getFileEmail4 file matches

@shouser•Updated 1 month ago
A helper function to build a file's email
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.