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/$%7BsvgDataUrl%7D?q=function&page=42&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 30890 results for "function"(949ms)

2import { db } from "./db.ts";
3
4export async function createTables() {
5 // Uncomment to reset database
6 // await db.run(sql`DROP TABLE IF EXISTS messages`);

anchorPDSauth.ts1 match

@tijsUpdated 2 days ago
9const CACHE_TTL = 3600000; // 1 hour
10
11export async function validateToken(token: string): Promise<AuthContext | null> {
12 console.log(`🔐 Validating token: ${token.substring(0, 20)}... (length: ${token.length})`);
13

anchorPDSanchor.ts1 match

@tijsUpdated 2 days ago
8
9// Middleware for authentication
10async function authenticateRequest(c: any) {
11 const authHeader = c.req.header("Authorization");
12 if (!authHeader || !authHeader.startsWith("Bearer ")) {

puk-timermain.tsx1 match

@paranoidrayUpdated 2 days ago
9// if(request.query.code == process.env.SECRET) {
10
11export default async function(req: Request): Promise<Response> {
12 const url = new URL(req.url);
13 const query = url.searchParams;

puk-timerold.tsx1 match

@paranoidrayUpdated 2 days ago
6// import { serveFile } from "../index.ts";
7
8export function staticHTTPServer(importMetaURL: string) {
9 const app = new Hono();
10 app.get("/", () => serveFile("/index.html", importMetaURL));

puk-timerindex.html1 match

@paranoidrayUpdated 2 days ago
50 <script>
51 let numbers = [];
52 function enterCode(code) {
53 numbers.push("" + code);
54 if (numbers.length > 4) {

girocodeindex.ts2 matches

@fxfrUpdated 2 days ago
115 * Creates a payment string in SEPA format for QR code generation
116 */
117function createPaymentString({ name, iban, bic, amount, reference }: {
118 name: string;
119 iban: string;
143 * Generates QR code as SVG using a QR code library
144 */
145async function generateQRCodeSVG(data: string): Promise<string> {
146 // Using qrcode library from esm.sh
147 const QRCode = await import("https://esm.sh/qrcode@1.5.3");

fashionWardrobefashionwardrobe1 match

@kaltesommerUpdated 2 days ago
9const WARDROBE_KEY = "wardrobe_items"; // NEW ← pick any key name you like
10
11export default async function(req: Request): Promise<Response> {
12 // --- always hydrate the in‑memory array from storage first -------------
13 wardrobe = (await blob.getJSON<WardrobeItem[]>(WARDROBE_KEY)) ?? [];

anchorPDStypes.ts8 matches

@tijsUpdated 2 days ago
60}
61
62// Validation functions
63export function validateCheckinRecord(record: any): CheckinRecord {
64 if (typeof record !== "object" || record === null) {
65 throw new Error("Record must be an object");
121}
122
123function validateGeoLocation(location: any): CommunityGeoLocation {
124 if (!location.latitude || typeof location.latitude !== "string") {
125 throw new Error("geo location must have latitude as string");
149}
150
151function validateAddressLocation(location: any): CommunityAddressLocation {
152 const validatedAddress: CommunityAddressLocation = {
153 $type: "community.lexicon.location.address",
200}
201
202// Utility functions
203export function generateRkey(): string {
204 return crypto.randomUUID();
205}
206
207export function createAtUri(did: string, collection: string, rkey: string): string {
208 return `at://${did}/${collection}/${rkey}`;
209}
210
211export function generateCid(): string {
212 // Simple CID generation (in production, use proper IPLD/DAG-CBOR)
213 return `baf${Math.random().toString(36).substring(2, 15)}`;

anchorPDSmigrations.ts1 match

@tijsUpdated 2 days ago
6
7// Initialize database schema
8export async function initializeDatabase() {
9 // Create checkins table (v2 - lexicon compliant)
10 await sqlite.execute(`
tuna

tuna9 file matches

@jxnblkUpdated 1 week ago
Simple functional CSS library for Val Town

getFileEmail4 file matches

@shouserUpdated 1 month ago
A helper function to build a file's email
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": "*",
webup
LangChain (https://langchain.com) Ambassador, KubeSphere (https://kubesphere.io) Ambassador, CNCF OpenFunction (https://openfunction.dev) TOC Member.