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=3&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 18181 results for "function"(772ms)

templateTwitterAlertmain.tsx1 match

@divya88•Updated 7 hours ago
12const isProd = false;
13
14export async function twitterAlert({ lastRunAt }: Interval) {
15 // If isProd, search for tweets since that last time this interval ran
16 // if not, search for tweets since 48 hours ago for testing

testPondiversemain1 match

@argmn•Updated 8 hours 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();

growingEmeraldGrasshoppermain.tsx3 matches

@speedadd•Updated 8 hours ago
19- Respond in English, providing clear and direct answers`;
20
21function ChatInterface() {
22 const [messages, setMessages] = useState([]);
23 const [inputValue, setInputValue] = useState("");
415}
416
417function client() {
418 createRoot(document.getElementById("root")).render(<ChatInterface />);
419}
420if (typeof document !== "undefined") { client(); }
421
422export default async function server(request: Request): Promise<Response> {
423 if (request.method === "POST" && new URL(request.url).pathname === "/chat") {
424 try {

wonderfulBlushMagpiemain.tsx3 matches

@bgtgtgfgvbtgvgb•Updated 9 hours ago
3import { createRoot } from "https://esm.sh/react-dom@18.2.0/client";
4
5function App() {
6 const [shorts, setShorts] = useState<{id: number, link: string}[]>([]);
7 const [newShortLink, setNewShortLink] = useState('');
185}
186
187function client() {
188 createRoot(document.getElementById("root")).render(<App />);
189}
191if (typeof document !== "undefined") { client(); }
192
193export default async function handler(request: Request): Promise<Response> {
194 const { sqlite } = await import("https://esm.town/v/stevekrouse/sqlite");
195 const KEY = "wonderfulBlushMagpie";

funAnimatedVocabularymain.tsx3 matches

@bgtgtgfgvbtgvgb•Updated 9 hours ago
119};
120
121function App() {
122 const [currentWord, setCurrentWord] = useState('');
123 const [definition, setDefinition] = useState('');
354}
355
356function client() {
357 createRoot(document.getElementById("root")).render(<App />);
358}
360if (typeof document !== "undefined") { client(); }
361
362export default async function handler(request: Request): Promise<Response> {
363 if (request.method === 'GET') {
364 return new Response(`

replicache-forknew-file-8157.tsx1 match

@jeffreyyoung•Updated 9 hours ago
1export default async function(req: Request): Promise<Response> {
2 const url = new URL(req.url);
3 if (url.pathname === "/v1") {

LannyBfmain.tsx3 matches

@diepah•Updated 10 hours ago
16];
17
18function App() {
19 const [noClicks, setNoClicks] = useState(0);
20 const [isValentine, setIsValentine] = useState(false);
101}
102
103function client() {
104 createRoot(document.getElementById("root")).render(<App />);
105}
106if (typeof document !== "undefined") { client(); }
107
108export default async function server(request: Request): Promise<Response> {
109 return new Response(
110 `
20
21// Main handler for HTTP requests
22export default async function(req: Request): Promise<Response> {
23 console.log("Request received:", req.method);
24
103
104// Extract issue numbers from PR body
105function extractIssueNumbers(body: string): number[] {
106 // Match common issue linking keywords, hacky
107 const patterns = [
128
129// Update PR title
130async function updatePRTitle(repo: string, prNumber: number, newTitle: string) {
131 const token = Deno.env.get("GITHUB_TOKEN");
132
28
29// Main handler for HTTP requests
30export default async function(req: Request): Promise<Response> {
31 console.log("Request received:", req.method);
32
130
131// Extract issue numbers from PR body
132function extractIssueNumbers(body: string): number[] {
133 // Match common issue linking keywords
134 const patterns = [
155
156// Fetch issue details
157async function fetchIssue(repo: string, issueNumber: number): Promise<GitHubIssue> {
158 const token = Deno.env.get("GITHUB_TOKEN");
159
187
188// Add labels to PR
189async function addLabelsToPR(repo: string, prNumber: number, labels: string[]) {
190 const token = Deno.env.get("GITHUB_TOKEN");
191

hungarianVocabnew-file-5047.tsx3 matches

@josephmarks•Updated 10 hours ago
3import React, { useCallback, useMemo, useState } from "https://esm.sh/react@18.2.0";
4
5function FlashcardApp() {
6 const flashcards = [
7 // --- Your flashcard data array remains unchanged here ---
296}
297
298function client() {
299 createRoot(document.getElementById("root")).render(<FlashcardApp />);
300}
301if (typeof document !== "undefined") { client(); }
302
303export default async function server(request: Request): Promise<Response> {
304 return new Response(
305 `

getFileEmail4 file matches

@shouser•Updated 1 week 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": "*",