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/$%7Bart_info.art.src%7D?q=function&page=1595&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 19470 results for "function"(2067ms)

effectmain.tsx2 matches

@dvdsgl•Updated 9 months ago
9 : `${Duration.toMillis(d)}ms`;
10
11export function withTimeLog<A, E, C>(
12 label: string,
13): (self: Effect.Effect<A, E, C>) => Effect.Effect<A, E, C> {
14 return (self) =>
15 Effect.gen(function*() {
16 const start = yield* Clock.currentTimeMillis;
17 const result = yield* self;

graphQLYogaWithSubscriptionsmain.tsx1 match

@dthyresson•Updated 9 months ago
31 countdown: {
32 // This will return the value on every 1 sec until it reaches 0
33 subscribe: async function*(_, { from }) {
34 for (let i = from; i >= 0; i--) {
35 await setTimeout(1000);

compileAndUploadTinygoWasmREADME.md1 match

@kora•Updated 9 months ago
36const resp = await fetch("https://maxm-wasmBlobHost.web.val.run/jpxqvyy5tphiwehzklmioklpkpz4gpzs.wasm");
37const handler = await wasmHandler(new Uint8Array(await resp.arrayBuffer()));
38export default async function(req: Request): Promise<Response> {
39 return handler(req);
40}

compileAndUploadTinygoWasmmain.tsx1 match

@kora•Updated 9 months ago
59const resp = await fetch("${url}");
60const handler = await wasmHandler(new Uint8Array(await resp.arrayBuffer()));
61export default async function(req: Request): Promise<Response> {
62 return handler(req);
63}`);

memain.tsx1 match

@dthyresson•Updated 9 months ago
1export function handler(request: Request) {
2 return Response.redirect('https://www.thyresson.io')
3}

coffeeReptilemain.tsx1 match

@tempguy•Updated 9 months ago
1import { blob } from "https://esm.town/v/std/blob?v=12";
2export default async function(interval: Interval) {
3 await fetch("https://tempguy-scarletsole.web.val.run/refresh");
4 const date = new Date();

tealPheasantmain.tsx5 matches

@tempguy•Updated 9 months ago
11const captchaId = $("input[name=\"captcha_id\"]").val();
12const captchaAnswerValues = [];
13$("input[name=\"captcha_answer[]\"]").each(function() {
14 captchaAnswerValues.push($(this).val());
15});
33 "Cache-Control": "no-cache",
34};
35function getCombinations(arr, k) {
36 const result = [];
37
38 // Helper function to generate combinations recursively
39 function combine(prefix, start) {
40 if (prefix.length === k) {
41 result.push(prefix);
56
57console.log(combinations.length);
58async function postCombinations(combinations, url, headers, captchaId) {
59 for (const combination of combinations) {
60 // Create the body for the POST request

maroonBandicootmain.tsx1 match

@tempguy•Updated 9 months ago
1import { fetch } from "https://esm.town/v/std/fetch";
2export default async function(request: Request) {
3 const url = new URL(request.url);
4 const h = url.searchParams.get("tdestination");

scarletClammain.tsx1 match

@justinenerio•Updated 9 months ago
1export default async function (req: Request): Promise<Response> {
2 return Response.json({ ok: true, msg: 'saba jah allergic kag air'})
3}

jsPythonmain.tsx2 matches

@kora•Updated 9 months ago
2
3const script = `
4def mapFunction(r, i):
5 v = r * i
6 return v
8x = [1, 2, 3, 4]
9x
10 .map(mapFunction)
11 .filter(r => r * r)
12 .join(",")

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.