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=1&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 7144 results for "function"(408ms)

pondiversegetCreation1 match

@iliazeus•Updated 1 hour ago
3import { TABLE_NAME } from "./updateTable";
4
5export default async function(req: Request): Promise<Response> {
6 // url query
7 // ?c=id - for creation image

pondiverseupdateTable1 match

@iliazeus•Updated 1 hour ago
2
3export const TABLE_NAME = "pondiverse_creations_v4";
4export default async function(req: Request): Promise<Response> {
5 await sqlite.execute(
6 `CREATE TABLE IF NOT EXISTS ${TABLE_NAME} (

pondiversefetchCreations1 match

@iliazeus•Updated 1 hour 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(`

pondiverseaddCreation1 match

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

JimeluStevenshandleAccountantEmail1 match

@luke_f•Updated 1 hour ago
1import { DateTime } from "https://esm.sh/luxon@3.4.4";
2
3export default async function(e: Email) {
4 console.log("Received accountant email");
5 const { sqlite } = await import("https://esm.town/v/stevekrouse/sqlite");

JimeluStevenssendDailyBrief.ts6 matches

@luke_f•Updated 1 hour ago
6import { formatMemoriesForPrompt, getRelevantMemories } from "../memoryUtils.ts";
7
8async function generateBriefingContent(anthropic, memories, today, isSunday) {
9 try {
10 const weekdaysHelp = generateWeekDays(today);
90}
91
92export async function sendDailyBriefing(chatId?: string, today?: DateTime) {
93 // Get API keys from environment
94 const apiKey = Deno.env.get("ANTHROPIC_API_KEY");
129 const lastSunday = today.startOf("week").minus({ days: 1 });
130
131 // Fetch relevant memories using the utility function
132 const memories = await getRelevantMemories();
133
210}
211
212function generateWeekDays(today) {
213 let output = [];
214
233// console.log(weekDays);
234
235// Export a function that calls sendDailyBriefing with no parameters
236// This maintains backward compatibility with existing cron jobs
237export default async function(overrideToday?: DateTime) {
238 return await sendDailyBriefing(undefined, overrideToday);
239}

JimeluStevenshandleUSPSEmail.ts3 matches

@luke_f•Updated 1 hour ago
4const RECIPIENTS = ["Geoffrey", "Maggie"] as const;
5
6function parseDateFromSubject(subject: string): string | null {
7 const match = subject.match(/(\w{3}), (\d{1,2}\/\d{1,2})/);
8 if (match) {
19};
20
21async function analyzeHtmlContent(
22 anthropic: Anthropic,
23 htmlContent: string,
81}
82
83export default async function(e: Email) {
84 console.log("email content");
85 console.log(e.html);

CTGBreakerfarcaster.ts3 matches

@horsefacts•Updated 4 hours ago
5export const name = "CTG Breaker";
6
7export function embedMetadata(baseUrl: string, path: string = "/") {
8 return {
9 version: "next",
23}
24
25export function handleFarcasterEndpoints(app: Hono) {
26 app.get("/.well-known/farcaster.json", (c) => {
27 const baseUrl = c.req.url.replace(c.req.path, "");
77const decodeBase64Json = (str: string) => JSON.parse(Buffer.from(str, "base64").toString("utf-8"));
78
79async function sendWelcomeNotification(fid: number, baseUrl: string) {
80 return await sendNotificationToUser(fid, {
81 title: name + " saved!",

CTGBreakerFarcasterMiniApp.tsx1 match

@horsefacts•Updated 4 hours ago
4import { formatAddress, formatJSON, MonoButtonWithStatus, Section } from "./ui.tsx";
5
6export function FarcasterMiniApp() {
7 const [context, setContext] = useState<any>();
8 const [contextExpanded, setContextExpanded] = useState(false);

CTGBreakerindex.tsx1 match

@horsefacts•Updated 4 hours ago
35});
36
37function generateHtml(baseUrl: string, path: string = "/"): any {
38 return (
39 <html>

getFileEmail4 file matches

@shouser•Updated 3 days ago
A helper function to build a file's email

TwilioHelperFunctions

@vawogbemi•Updated 2 months ago