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%22Optional%20title%22?q=function&page=21&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 18740 results for "function"(1355ms)

pondiversegetCreations1 match

@gaimeri17•Updated 23 hours 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

@gaimeri17•Updated 23 hours 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

@gaimeri17•Updated 23 hours 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

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

pondiverseaddCreation1 match

@gaimeri17•Updated 23 hours ago
4import { TABLE_NAME } from "./updateTable";
5
6export default async function(req: Request): Promise<Response> {
7 // body contains:
8 // - title (string)

gpt-image-testnew-file-2476.tsx1 match

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

HHGtoMyDayqueries.ts4 matches

@lm3m•Updated 1 day ago
6// const tableName = "memories_demo";
7
8export async function getAllMemories(): Promise<Memory[]> {
9 const result = await sqlite.execute(
10 `SELECT id, date, text, createdBy, createdDate, tags FROM ${tableName}
23}
24
25export async function createMemory(
26 memory: Omit<Memory, "id">,
27): Promise<Memory> {
51}
52
53export async function updateMemory(
54 id: string,
55 memory: Partial<Omit<Memory, "id">>,
70}
71
72export async function deleteMemory(id: string): Promise<void> {
73 await sqlite.execute(`DELETE FROM ${tableName} WHERE id = ?`, [id]);
74}

HHGtoMyDaymigrateMemoriesDb.ts1 match

@lm3m•Updated 1 day ago
2// Run this script manually to add new columns to the memories table
3
4export default async function migrateMemoriesDb() {
5 try {
6 // Import SQLite module

HHGtoMyDaycronDailyBrief.ts1 match

@lm3m•Updated 1 day ago
1import { sendDailyBriefing } from "./sendDailyBrief.ts";
2
3export async function cronDailyBrief() {
4 try {
5 console.log("Sending scheduled daily briefing...");

HHGtoMyDaytestDailyBrief.ts1 match

@lm3m•Updated 1 day ago
4import { sendDailyBriefing } from "./sendDailyBrief.ts";
5
6export async function testDailyBrief() {
7 try {
8 // const testChatId = Deno.env.get("TEST_TELEGRAM_CHAT_ID");

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