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=860&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 10292 results for "function"(694ms)

inspiringLavenderTakinmain.tsx9 matches

@stevekrouse•Updated 4 months ago
15 "recipe ingredient converter and scaler",
16 "morse code translator with audio output",
17 "random quote generator with tweet functionality",
18 "personal finance tracker with basic charts",
19 "multiplayer rock-paper-scissors game",
20];
21
22function Dashboard() {
23 const [stats, setStats] = useState<{
24 totalGenerations: number;
36
37 useEffect(() => {
38 async function fetchStats() {
39 const response = await fetch("/dashboard-stats");
40 const data = await response.json();
115}
116
117function App() {
118 const [prompt, setPrompt] = useState(
119 STARTER_PROMPTS[Math.floor(Math.random() * STARTER_PROMPTS.length)],
141 });
142
143 async function handleSubmit(e: React.FormEvent) {
144 e.preventDefault();
145 setLoading(true);
174 }
175
176 function handleVersionChange(direction: "back" | "forward") {
177 const { currentVersionIndex, versions } = versionHistory;
178
305}
306
307function client() {
308 const path = window.location.pathname;
309 const root = createRoot(document.getElementById("root")!);
320}
321
322function extractCodeFromFence(text: string): string {
323 const htmlMatch = text.match(/```html\n([\s\S]*?)\n```/);
324 return htmlMatch ? htmlMatch[1].trim() : text;
325}
326
327export default async function server(req: Request): Promise<Response> {
328 // Dynamic import for SQLite to avoid client-side import
329 const { sqlite } = await import("https://esm.town/v/stevekrouse/sqlite");

projectTweetGallerymain.tsx5 matches

@manyone•Updated 4 months ago
22];
23
24function TweetEmbed({ tweetId }) {
25 const containerRef = useRef(null);
26
54}
55
56function TweetGallery() {
57 return (
58 <div className="tweet-gallery">
62}
63
64function App() {
65 return (
66 <div className="dark-mode">
78}
79
80function client() {
81 createRoot(document.getElementById("root")).render(<App />);
82}
83if (typeof document !== "undefined") { client(); }
84
85export default async function server(request: Request): Promise<Response> {
86 return new Response(
87 `

cleanupmain.tsx1 match

@flymaster•Updated 4 months ago
1export default async function(interval: Interval) {
2 const ntfyChannel = Deno.env.get("CLEANUP_NTFY");
3 const cleanupFormUrl = Deno.env.get("CLEANUP_FORM");

getShowcaseValsmain.tsx2 matches

@stevekrouse•Updated 4 months ago
49});
50
51async function getDescriptions(val) {
52 const completion = await openai.beta.chat.completions.parse({
53 model: "gpt-4o-mini",
75}, { concurrency: 3 });
76
77async function getScreenshot(url: string) {
78 const resp = await fetch(
79 "https://api.apiflash.com/v1/urltoimage?" + new URLSearchParams({

pioneeringAzurePenguinmain.tsx5 matches

@saadstore•Updated 4 months ago
22];
23
24function VideoUploadModal({ isOpen, onClose, onUpload }) {
25 const [description, setDescription] = useState('');
26 const [file, setFile] = useState(null);
61}
62
63function VideoCard({ video }) {
64 const [likes, setLikes] = useState(video.likes);
65 const [isLiked, setIsLiked] = useState(false);
95}
96
97function App() {
98 const [videos, setVideos] = useState(mockVideos);
99 const [isUploadModalOpen, setIsUploadModalOpen] = useState(false);
136}
137
138function client() {
139 createRoot(document.getElementById("root")).render(<App />);
140}
141if (typeof document !== "undefined") { client(); }
142
143export default async function server(request: Request): Promise<Response> {
144 return new Response(`
145 <html>

widemain.tsx1 match

@maxm•Updated 4 months ago
74}
75
76export default async function(req: Request): Promise<Response> {
77 // Use your Val Town API Token to create a session
78 const wide = new Wide(await ValSession.new(Deno.env.get("valtown")));

reflective_qamain.tsx3 matches

@stevekrouse•Updated 4 months ago
10import React, { useEffect, useRef, useState } from "https://esm.sh/react@18.2.0";
11
12function App() {
13 const [notification, setNotification] = useState({ type: "success", message: "" });
14
329}
330
331function client() {
332 createRoot(document.getElementById("root")).render(<App />);
333}
334if (typeof document !== "undefined") { client(); }
335
336export default async function server(request: Request): Promise<Response> {
337 if (request.method === "POST" && new URL(request.url).pathname === "/ask") {
338 try {

GameAwards2024PredictionGamemain.tsx3 matches

@bmitchinson•Updated 4 months ago
3import { createRoot } from "https://esm.sh/react-dom/client";
4
5function App() {
6 const [predictions, setPredictions] = useState({});
7 const [username, setUsername] = useState("");
149}
150
151function client() {
152 createRoot(document.getElementById("root")).render(<App />);
153}
156}
157
158export default async function server(request: Request): Promise<Response> {
159 const { sqlite } = await import("https://esm.town/v/stevekrouse/sqlite");
160 const KEY = "GameAwards2024PredictionGame";

currencymain.tsx1 match

@luizhrios•Updated 4 months ago
1import { fetch } from "https://esm.town/v/std/fetch";
2
3function fetchJSON(url) {
4 return fetch(url).then(res => res.json());
5}

productiveRosePeacockmain.tsx9 matches

@stevekrouse•Updated 4 months ago
15 "recipe ingredient converter and scaler",
16 "morse code translator with audio output",
17 "random quote generator with tweet functionality",
18 "personal finance tracker with basic charts",
19 "multiplayer rock-paper-scissors game",
20];
21
22function Dashboard() {
23 const [stats, setStats] = useState<{
24 totalGenerations: number;
36
37 useEffect(() => {
38 async function fetchStats() {
39 const response = await fetch("/dashboard-stats");
40 const data = await response.json();
115}
116
117function App() {
118 const [prompt, setPrompt] = useState(
119 STARTER_PROMPTS[Math.floor(Math.random() * STARTER_PROMPTS.length)],
141 });
142
143 async function handleSubmit(e: React.FormEvent) {
144 e.preventDefault();
145 setLoading(true);
174 }
175
176 function handleVersionChange(direction: "back" | "forward") {
177 const { currentVersionIndex, versions } = versionHistory;
178
305}
306
307function client() {
308 const path = window.location.pathname;
309 const root = createRoot(document.getElementById("root")!);
320}
321
322function extractCodeFromFence(text: string): string {
323 const htmlMatch = text.match(/```html\n([\s\S]*?)\n```/);
324 return htmlMatch ? htmlMatch[1].trim() : text;
325}
326
327export default async function server(req: Request): Promise<Response> {
328 // Dynamic import for SQLite to avoid client-side import
329 const { sqlite } = await import("https://esm.town/v/stevekrouse/sqlite");

getFileEmail4 file matches

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

TwilioHelperFunctions

@vawogbemi•Updated 2 months ago