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=1237&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 18664 results for "function"(5512ms)

oauthmain.tsx1 match

@pomdtr•Updated 3 months ago
1type Handler = (req: Request) => Response | Promise<Response>;
2
3export function oauth(params: any, next: (req: Request, accessToken: string) => Response | Promise<Response>): Handler {
4 return (req: Request) => {
5 // TODO: go through oauth flow to extract access token

areMyWebsitesDownmain.tsx1 match

@kylesezhi•Updated 3 months ago
6);
7
8export async function uptimeCheck(url: string) {
9 let ok = true;
10 let reason: string;

diplomaticApricotHeronmain.tsx4 matches

@gigmx•Updated 3 months ago
14}
15
16function App() {
17 const [launches, setLaunches] = useState<TokenLaunch[]>([]);
18
67}
68
69function LaunchCard({ launch }: { launch: TokenLaunch }) {
70 return (
71 <div className="launch-card">
82}
83
84function client() {
85 createRoot(document.getElementById("root")).render(<App />);
86}
90}
91
92export default async function server(request: Request): Promise<Response> {
93 const { blob } = await import("https://esm.town/v/std/blob");
94 const KEY = "diplomaticApricotHeron";

stripeTriggermain.tsx2 matches

@wolf•Updated 3 months ago
9}>;
10
11export function bindAction(actionUrl: string) {
12 bindActionToTrigger(actionUrl, import.meta.url)
13}
20);
21
22export default async function trigger(req: Request): Promise<Response> {
23 const url = new URL(req.url);
24

triggerUtilsmain.tsx4 matches

@wolf•Updated 3 months ago
2import { valUrlToId } from "https://esm.town/v/wolf/valUrlToId?v=73";
3
4function getBlobKey(triggerUrl: string) {
5 const blobPrefix = "demo-webhook-trigger";
6 return `${blobPrefix}:${triggerUrl}`;
7}
8
9export async function bindActionToTrigger(actionUrl: string, triggerUrl: string) {
10 const triggerId = await valUrlToId(triggerUrl);
11 const blobKey = getBlobKey(triggerUrl);
16}
17
18export async function unbindActionFromTrigger(actionUrl: string, triggerUrl: string) {
19 const triggerId = await valUrlToId(triggerUrl);
20 const blobKey = getBlobKey(triggerUrl);
25}
26
27export async function listActionsForTrigger(triggerUrl: string): Promise<string[]> {
28 const triggerId = await valUrlToId(triggerUrl);
29 const blobKey = getBlobKey(triggerUrl);

valUrlToIdmain.tsx1 match

@wolf•Updated 3 months ago
2const headers = { "User-Agent": "Mozilla/5.0" };
3
4export async function valUrlToId(valUrl: string | undefined) {
5 if (!valUrl) valUrl = import.meta.url;
6 const valTownPage = valUrl.replace("esm.town", "val.town");

stripeWebsocketDemotriggerUtils1 match

@wolf•Updated 3 months ago
5console.log(await valUrlToId(import.meta.url));
6
7export async function bindToHandler(handlerId: string) {
8 const thisValId = await valUrlToId(import.meta.url);
9 return;

stripeWebsocketDemostripeHandler1 match

@wolf•Updated 3 months ago
2import { valUrlToId } from "https://esm.town/v/wolf/valUrlToId?v=39";
3
4export async function bindToHandler(handlerId: string) {
5 const thisValId = await valUrlToId(import.meta.url);
6 const actions = new Set<string>(await blob.getJSON(handlerId));

stripeWebsocketDemostripeTrigger1 match

@wolf•Updated 3 months ago
9);
10
11export async function trigger(req: Request): Promise<Response> {
12 const url = new URL(req.url);
13

twitterAlertmain.tsx2 matches

@ellie•Updated 3 months ago
9 .join(" OR ") + " " + excludes;
10
11function relevant(t: Tweet) {
12 if (keywords.some(k => t.full_text?.includes(k))) return true;
13 return t.entities.urls?.some(u => keywords.some(k => u.expanded_url?.includes(k)));
18const isProd = true;
19
20export async function twitterAlert({ lastRunAt }: Interval) {
21 // search
22 const since = isProd

getFileEmail4 file matches

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

tuna8 file matches

@jxnblk•Updated 2 weeks 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": "*",