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%22Image%20title%22?q=function&page=2&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 40414 results for "function"(1183ms)

transit-proxymain.ts1 match

@easrngโ€ขUpdated 4 hours ago
1export default async function (req: Request): Promise<Response> {
2 if (req.method !== "GET") {
3 return new Response("Method Not Allowed", { status: 405 });

webgpu_2main.tsx3 matches

@saolsenโ€ขUpdated 4 hours ago
10import module_path from "./module_path.tsx"
11
12async function main() {
13 const grid_shader = await (await fetch(`${module_path}/grid.wgsl`)).text();
14
210 let depth_texture: GPUTexture;
211
212 function render() {
213 const fov = 60 * Math.PI / 180;
214 const aspect = canvas.width / canvas.height;
294}
295
296function fail(msg: string) {
297 alert(msg);
298}

sheets-notificationsendpoint.ts1 match

@nbbaierโ€ขUpdated 6 hours ago
1// Learn more: https://docs.val.town/vals/http/
2export default async function (req: Request): Promise<Response> {
3 if (req.method === "POST") {
4 try {

untitled-5100main.ts1 match

@chatgotโ€ขUpdated 7 hours ago
1export default async function (req: Request): Promise<Response> {
2 const url = new URL(req.url);
3 const mode = url.searchParams.get("mode") || "scoreboard";
60โ”œโ”€โ”€ shared/ # Shared utilities and types
61โ”‚ โ”œโ”€โ”€ types.ts # TypeScript interfaces for Notion data
62โ”‚ โ”œโ”€โ”€ utils.ts # Shared utility functions
63โ”‚ โ””โ”€โ”€ README.md
64โ””โ”€โ”€ main.tsx # Application entry point with static file serving
73- Extracts parameters from requests
74- Applies authentication middleware
75- Calls controller functions and formats responses
76- Manages HTTP status codes and error responses
77
89
90### Response Format
91All controller functions return a consistent structure:
92```typescript
93{
137
138#### **User Experience**
139- **Error Handling**: Graceful error states with retry functionality
140- **Loading States**: Smooth loading indicators
141- **Navigation**: Easy return to dashboard
208- Filter out button properties from Notion page data
209- Return standardized JSON responses (except authentication routes which redirect or show HTML)
210- Use the same controller functions as the API endpoints for consistency
211
212### New User Registration Flow
432## Environment Variables
433
434Configure these environment variables for full functionality:
435- `GLANCE_DEMOS_DB_ID` - Notion database ID for demos
436- `GLANCE_CONTENT_DB_ID` - Notion database ID for content
5} from "../services/notion/index.ts";
6
7export async function glimpseLoginHandler(c: Context) {
8 // Extract user email from context (set by authCheck middleware)
9 const userEmail = c.get("userEmail");
186}
187
188export async function glimpseThanksHandler(c: Context) {
189 // Extract user email from context (set by authCheck middleware)
190 const userEmail = c.get("userEmail");

guesty2homeitmain.ts1 match

@bernardoโ€ขUpdated 7 hours ago
4 "https://script.google.com/macros/s/AKfycbztFlFnno3h8cQPd-539fZiH--458uc3tJOgykLmE37bqSKT09NodHmvNffruwpTInjUQ/exec";
5
6export default async function handler(req: Request): Promise<Response> {
7 if (req.method !== "POST") {
8 return new Response("Only POST supported", { status: 405 });

croneinteractionRouter.ts1 match

@jrmann100โ€ขUpdated 7 hours ago
16 * Route the Discord interaction to the appropriate handler
17 */
18export async function handleInteraction(c: Context) {
19 const req = await c.req.json();
20

boychick-statusmain.ts1 match

@kellyiโ€ขUpdated 8 hours ago
1// Learn more: https://docs.val.town/vals/http/
2export default async function (req: Request): Promise<Response> {
3 return Response.json({ ok: true })
4}

webgpu_2server.tsx1 match

@saolsenโ€ขUpdated 8 hours ago
1import module_path from "./module_path.tsx"
2
3export default function (_req: Request): Response {
4 return new Response(
5 `

ratelimit4 file matches

@unkeyโ€ขUpdated 1 month ago
Rate limit your serverless functions

discordWebhook2 file matches

@stevekrouseโ€ขUpdated 2 months ago
Helper function to send Discord messages
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.