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/$%7Burl%7D?q=function&page=1761&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 24489 results for "function"(2883ms)

cerebras_codermain.tsx11 matches

@facundopri•Updated 3 months ago
24);
25
26function Hero({
27 prompt,
28 setPrompt,
45
46 <p className="text-[#bababa] text-center max-w-[25ch] mx-auto my-4 font-dm-sans">
47 Turn your ideas into fully functional apps in{" "}
48 <span className="relative w-fit text-fuchsia-400 z-10 italic font-semibold rounded-full">
49 less than a second
116}
117
118function App() {
119 const previewRef = React.useRef<HTMLDivElement>(null);
120 const [prompt, setPrompt] = useState("");
170 });
171
172 function handleStarterPromptClick(promptItem: typeof prompts[number]) {
173 setLoading(true);
174 setTimeout(() => handleSubmit(promptItem.prompt), 0);
175 }
176
177 async function handleSubmit(e: React.FormEvent | string) {
178 if (typeof e !== "string") {
179 e.preventDefault();
226 }
227
228 function handleVersionChange(direction: "back" | "forward") {
229 const { currentVersionIndex, versions } = versionHistory;
230 if (direction === "back" && currentVersionIndex > 0) {
974);
975
976function client() {
977 const path = window.location.pathname;
978 const root = createRoot(document.getElementById("root")!);
1010}
1011
1012function extractCodeFromFence(text: string): string {
1013 const htmlMatch = text.match(/```html\n([\s\S]*?)\n```/);
1014 return htmlMatch ? htmlMatch[1].trim() : text;
1015}
1016
1017async function generateCode(prompt: string, currentCode: string) {
1018 const starterPrompt = STARTER_PROMPTS.find(p => p.prompt === prompt);
1019 if (starterPrompt) {
1060}
1061
1062export default async function cerebras_coder(req: Request): Promise<Response> {
1063 // Dynamic import for SQLite to avoid client-side import
1064 const { sqlite } = await import("https://esm.town/v/stevekrouse/sqlite");
1163 <meta property="og:site_name" content="Cerebras Coder">
1164 <meta property="og:url" content="https://cerebrascoder.com"/>
1165 <meta property="og:description" content="Turn your ideas into fully functional apps in less than a second – powered by deepseek-r1-distill-llama-70b on Cerebras's super-fast wafer chips. Code is 100% open-source, hosted on Val Town."">
1166 <meta property="og:type" content="website">
1167 <meta property="og:image" content="https://stevekrouse-blob_admin.web.val.run/api/public/CerebrasCoderOG.jpg">

TestprojectfineRoseSquirrel1 match

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

yc_findermain.tsx5 matches

@reetkumarbind•Updated 3 months ago
23`;
24
25function Hero() {
26 return (
27 <div className="hero">
32}
33
34function HowItWorks() {
35 return (
36 <div className="how-it-works">
53}
54
55function App() {
56 const [ycCompanies, setYcCompanies] = useState<YCCompany[]>([]);
57 const [mergedData, setMergedData] = useState<any[]>([]);
217}
218
219function client() {
220 createRoot(document.getElementById("root")!).render(<App />);
221}
225}
226
227export default async function server(request: Request): Promise<Response> {
228 const companies = await fetch("https://stevekrouse-yc_database.web.val.run").then(res => res.json());
229 const url = new URL(request.url);

genuineSilverUrialmain.tsx3 matches

@wasifshaik773•Updated 3 months ago
3import { createRoot } from "https://esm.sh/react-dom@18.2.0/client";
4
5function GtaInfo() {
6 const [selectedCharacter, setSelectedCharacter] = useState(null);
7
69}
70
71function client() {
72 createRoot(document.getElementById("root")).render(<GtaInfo />);
73}
74if (typeof document !== "undefined") { client(); }
75
76export default async function server(request: Request): Promise<Response> {
77 return new Response(`
78 <html>

easygoingEmeraldGamefowlmain.tsx1 match

@toowired•Updated 3 months ago
69
70// Export for Val Town
71export async function test(args) {
72 return await runTests();
73}

exceptionalBlushCarpmain.tsx7 matches

@toowired•Updated 3 months ago
1import { blob } from '@val.town/utils';
2
3export async function windsurfIDE(args) {
4 const { type, ...params } = args;
5
22}
23
24async function handleStartGoal(goal) {
25 const state = await blob.get('windsurf_state') || {
26 goals: [],
58}
59
60async function handleCompleteTask(taskId) {
61 const state = await blob.get('windsurf_state');
62 if (!state) return { error: 'No active state' };
82}
83
84async function handleAutoNext() {
85 const state = await blob.get('windsurf_state');
86 if (!state || !state.currentGoal) return { status: "NO_ACTIVE_GOAL" };
116}
117
118async function loadMemory(memoryId) {
119 const state = await blob.get('windsurf_state');
120 if (!state) return { error: 'No active state' };
136}
137
138async function applyRule(rule, target, state) {
139 // Rule application logic
140 switch(rule.action) {
155}
156
157function prioritizeTask(task, state, criteria) {
158 // Task prioritization logic based on rules
159 return task;

luminousOrangeDingomain.tsx1 match

@toowired•Updated 3 months ago
69
70// Export for Val Town
71export async function test(args) {
72 return await runTests();
73}

tangibleBrownPtarmiganmain.tsx7 matches

@toowired•Updated 3 months ago
1import { blob } from '@val.town/utils';
2
3export async function windsurfIDE(args) {
4 const { type, ...params } = args;
5
22}
23
24async function handleStartGoal(goal) {
25 const state = await blob.get('windsurf_state') || {
26 goals: [],
58}
59
60async function handleCompleteTask(taskId) {
61 const state = await blob.get('windsurf_state');
62 if (!state) return { error: 'No active state' };
82}
83
84async function handleAutoNext() {
85 const state = await blob.get('windsurf_state');
86 if (!state || !state.currentGoal) return { status: "NO_ACTIVE_GOAL" };
116}
117
118async function loadMemory(memoryId) {
119 const state = await blob.get('windsurf_state');
120 if (!state) return { error: 'No active state' };
136}
137
138async function applyRule(rule, target, state) {
139 // Rule application logic
140 switch(rule.action) {
155}
156
157function prioritizeTask(task, state, criteria) {
158 // Task prioritization logic based on rules
159 return task;

bubblyMaroonLungfishmain.tsx1 match

@toowired•Updated 3 months ago
69
70// Export for Val Town
71export async function test(args) {
72 return await runTests();
73}

alluringSapphireStoatmain.tsx1 match

@toowired•Updated 3 months ago
69
70// Export for Val Town
71export async function test(args) {
72 return await runTests();
73}

getFileEmail4 file matches

@shouser•Updated 1 month ago
A helper function to build a file's email
tuna

tuna8 file matches

@jxnblk•Updated 1 month ago
Simple functional CSS library for Val Town
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.