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/$%7Bsuccess?q=function&page=19&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 18182 results for "function"(1671ms)

eink-frame-remixapod.ts1 match

@charmaineUpdated 1 day ago
13const NASA_API_KEY = Deno.env.get("NASA_API_KEY");
14
15export default async function GetAPOD(req: Request): Promise<Response> {
16 const url = `https://api.nasa.gov/planetary/apod?api_key=${NASA_API_KEY}&thumbs=true`;
17 const cacheKey = "nasa_apod";

yolomain.tsx1 match

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

x-cache-bugserver.ts1 match

@hacksoreUpdated 1 day ago
1export default function server(request: Request): Response {
2 // Define the redirect targets
3 const SPECIAL_REDIRECT_TARGET = "https://apple.com/apple-events";

pondiversemain1 match

@argmnUpdated 1 day ago
6import updateTable from "./updateTable";
7
8export default async function(req: Request): Promise<Response> {
9 let url = new URL(req.url);
10 const path = url.pathname.toLowerCase();

pondiversegetCreations1 match

@argmnUpdated 1 day ago
3import { TABLE_NAME } from "./updateTable";
4
5export default async function(req: Request): Promise<Response> {
6 // First, get the row IDs of all rows that are older than 25 hours old
7 const res = await sqlite.execute(`

pondiversegetCreationImage1 match

@argmnUpdated 1 day ago
3import { TABLE_NAME } from "./updateTable";
4
5export default async function(req: Request): Promise<Response> {
6 const url = new URL(req.url);
7 const id = url.searchParams.get("id");

pondiversegetCreation1 match

@argmnUpdated 1 day ago
3import { TABLE_NAME } from "./updateTable";
4
5export default async function(req: Request): Promise<Response> {
6 const url = new URL(req.url);
7 const id = url.searchParams.get("id");

pondiversedeleteCreation1 match

@argmnUpdated 1 day ago
4import { TABLE_NAME } from "./updateTable";
5
6export default async function(req: Request): Promise<Response> {
7 // body contains:
8 // - id (number)

untitled-9414main.tsx3 matches

@bernardoUpdated 1 day ago
13const webhookIdToDelete = "51a2064a0098b4feacadfd7db51f6a21"; // ← Change this
14
15async function listWebhooks(apiKey: string, propertyId: string): Promise<CloudbedsWebhook[]> {
16 const res = await fetch(`https://hotels.cloudbeds.com/api/v1.2/getWebhooks?propertyID=${propertyId}`, {
17 headers: { Authorization: `Bearer ${apiKey}` },
29}
30
31async function deleteWebhookById(apiKey: string, id: string, url: string, object: string, action: string) {
32 const body = new URLSearchParams({
33 subscriptionID: id,
52}
53
54export default async function() {
55 const user = await blob.getJSON(`cloudbeds_user_${userId}`);
56 const apiKey = user?.cloudbedsAccounts?.[propertyId]?.apiKey;

stevensDemotestDailyBrief.ts1 match

@tijsUpdated 1 day ago
4import { DateTime } from "https://esm.sh/luxon@3.4.4";
5
6export async function testDailyBrief() {
7 try {
8 const testChatId = Deno.env.get("TEST_TELEGRAM_CHAT_ID");

getFileEmail4 file matches

@shouserUpdated 1 week ago
A helper function to build a file's email
tuna

tuna8 file matches

@jxnblkUpdated 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": "*",