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/?q=function&page=1078&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 16765 results for "function"(1736ms)

discordWebhookExmain.tsx3 matches

@gigmx•Updated 3 months ago
96let monitor: PumpMonitor | null = null;
97
98function verifyDiscordRequest(request: Request): boolean {
99 const signature = request.headers.get('x-signature-ed25519');
100 const timestamp = request.headers.get('x-signature-timestamp');
108}
109
110async function handlePingCommand(): Promise<Response> {
111 let content: string;
112
133}
134
135export default async function (req: Request): Promise<Response> {
136 if (req.method !== 'POST') {
137 return new Response('Method not allowed', { status: 405 });

dynamicLavenderBeetleREADME.md1 match

@charmaine•Updated 3 months ago
63This val uses the SocialData API for Twitter data:
64- **Proxies via Val Town's SocialDataProxy**: Limited to 100 calls/day for [**Val Town Pro users**](https://www.val.town/pricing).
65- **Need more calls?** Sign up for your own [SocialData API token](https://socialdata.tools) and configure the [`socialDataSearch`](https://www.val.town/v/stevekrouse/socialDataSearch) function.

dynamicLavenderBeetlemain.tsx1 match

@charmaine•Updated 3 months ago
10const isProd = true;
11
12export async function twitterAlert({ lastRunAt }: Interval) {
13 // Scrapes data from past 48 hours time frame if testing
14 const timeFrame = isProd

hopefulApricotSparrowREADME.md1 match

@charmaine•Updated 3 months ago
63This val uses the SocialData API for Twitter data:
64- **Proxies via Val Town's SocialDataProxy**: Limited to 100 calls/day for [**Val Town Pro users**](https://www.val.town/pricing).
65- **Need more calls?** Sign up for your own [SocialData API token](https://socialdata.tools) and configure the [`socialDataSearch`](https://www.val.town/v/stevekrouse/socialDataSearch) function.

hopefulApricotSparrowmain.tsx1 match

@charmaine•Updated 3 months ago
10const isProd = true;
11
12export async function twitterAlert({ lastRunAt }: Interval) {
13 // Scrapes data from past 48 hours time frame if testing
14 const timeFrame = isProd

evalCodemain.tsx2 matches

@tmcw•Updated 3 months ago
1import safeJsonValue from "npm:safe-json-value";
2
3export async function evalCode(
4 code: string,
5): Promise<{ error: { message: string; name: string; stack: string } } | any> {
43}
44
45function getMainExport(
46 mod: any,
47): { ok: true; value: any } | { ok: false; error: Error } {

widemain.tsx1 match

@tmcw•Updated 3 months ago
74}
75
76export default async function(req: Request): Promise<Response> {
77 // Use your Val Town API Token to create a session
78 const wide = new Wide(await ValSession.new(Deno.env.get("valtown")));

thankfulTurquoiseParrotREADME.md1 match

@tmcw•Updated 3 months ago
25);
26
27function formatPEM(b64: string, type: "PRIVATE KEY" | "PUBLIC KEY"): string {
28 const lines = b64.match(/.{1,64}/g) || [];
29 return `-----BEGIN ${type}-----\n${lines.join("\n")}\n-----END ${type}-----`;

thankfulTurquoiseParrotmain.tsx2 matches

@tmcw•Updated 3 months ago
20`;
21
22async function newSession(valTownToken: string) {
23 const privateKeyPem = `
24-----BEGIN PRIVATE KEY-----
38}
39
40function validate(token: string) {
41 const decoded = jwt.verify(token, publicKeyPem, { algorithms: ["RS256"] }) as
42 & Awaited<

valSessionREADME.md1 match

@tmcw•Updated 3 months ago
25);
26
27function formatPEM(b64: string, type: "PRIVATE KEY" | "PUBLIC KEY"): string {
28 const lines = b64.match(/.{1,64}/g) || [];
29 return `-----BEGIN ${type}-----\n${lines.join("\n")}\n-----END ${type}-----`;

getFileEmail4 file matches

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

tuna8 file matches

@jxnblk•Updated 1 week ago
Simple functional CSS library for Val Town
webup
LangChain (https://langchain.com) Ambassador, KubeSphere (https://kubesphere.io) Ambassador, CNCF OpenFunction (https://openfunction.dev) TOC Member.
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": "*",