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=2106&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 29303 results for "function"(5737ms)

funPurpleStingrayefficientTurquoiseJay1 match

@charmaine•Updated 3 months ago
1export default async function(req: Request): Promise<Response> {
2 const html = `
3 <!DOCTYPE html>

superPeachParrotfishmain.tsx8 matches

@nadaamiinn•Updated 3 months ago
3import { createRoot } from "https://esm.sh/react-dom@18.2.0/client";
4
5function JobPostingForm() {
6 const [title, setTitle] = useState("");
7 const [company, setCompany] = useState("");
54}
55
56function JobBoard({ jobs }) {
57 return (
58 <div className="job-board">
69}
70
71function UsernameModal({ onSetUsername }) {
72 const [username, setUsername] = useState("");
73 const [error, setError] = useState("");
106}
107
108function ChatRoom() {
109 const [messages, setMessages] = useState([]);
110 const [newMessage, setNewMessage] = useState("");
186}
187
188function TabNavigation({ activeTab, onTabChange }) {
189 return (
190 <div className="tab-navigation">
205}
206
207function App() {
208 const [jobs, setJobs] = useState([]);
209 const [activeTab, setActiveTab] = useState('jobs');
249}
250
251function client() {
252 createRoot(document.getElementById("root")).render(<App />);
253}
254if (typeof document !== "undefined") { client(); }
255
256export default async function server(request: Request): Promise<Response> {
257 const { sqlite } = await import("https://esm.town/v/stevekrouse/sqlite");
258 const SCHEMA_VERSION = 2; // Increment schema version

tsEvaltsEval1 match

@tmcw•Updated 3 months ago
3import { newWorker } from "./worker";
4
5function encodeSSE(data: any) {
6 return new TextEncoder().encode(`data: ${JSON.stringify(data)}\r\n\r\n`);
7}

exclusiveFuchsiaEaglefreeAquaBandicoot1 match

@tmcw•Updated 3 months ago
1export default async function(req: Request): Promise<Response> {
2 return new Response("Hello World", {
3 headers: { "Content-Type": "text/plain" },

linkInBioTemplatemain.tsx1 match

@joker4mas•Updated 3 months ago
2import { renderToString } from "npm:react-dom/server";
3
4export default async function(req: Request) {
5 return new Response(
6 renderToString(
77];
78
79function App() {
80 const [selectedInstrument, setSelectedInstrument] = useState(null);
81 const [file, setFile] = useState(null);
199}
200
201function client() {
202 createRoot(document.getElementById("root")).render(<App />);
203}
204if (typeof document !== "undefined") { client(); }
205
206export default async function server(request: Request) {
207 if (request.method === "POST" && new URL(request.url).pathname === "/identify") {
208 try {
244}
245
246async function identifyInstrument(audioBuffer: ArrayBuffer) {
247 const instruments = INSTRUMENTS.map(i => i.name);
248 const randomIndex = Math.floor(Math.random() * instruments.length);

agileApricotPossummain.tsx5 matches

@Koka•Updated 3 months ago
4
5// Gamification and Progress Tracking
6function UserProgress() {
7 const [points, setPoints] = useState(0);
8 const [level, setLevel] = useState(1);
34
35// Pomodoro Focus Timer
36function PomodoroTimer() {
37 const [timeLeft, setTimeLeft] = useState(25 * 60);
38 const [isRunning, setIsRunning] = useState(false);
89
90// Main App Component
91function StudySparkApp() {
92 const [courses, setCourses] = useState([]);
93 const [newCourse, setNewCourse] = useState({ name: "", assignments: [] });
142
143// Client-side rendering
144function client() {
145 createRoot(document.getElementById("root")).render(<StudySparkApp />);
146}
148
149// Server-side rendering
150export default async function server(request: Request): Promise<Response> {
151 // Future: Integrate OpenAI for AI-powered task breakdown
152 // const { OpenAI } = await import("https://esm.town/v/std/openai");
15];
16
17function InstrumentConfidenceBar({ name, emoji, confidence }) {
18 return (
19 <div style={{
60}
61
62function App() {
63 const [recording, setRecording] = useState(false);
64 const [result, setResult] = useState(null);
294}
295
296function client() {
297 createRoot(document.getElementById("root")).render(<App />);
298}
299if (typeof document !== "undefined") { client(); }
300
301export default async function server(request: Request): Promise<Response> {
302 if (request.method === 'POST' && new URL(request.url).pathname === '/classify') {
303 try {

jobAndChatAppmain.tsx2 matches

@oluwadarejohn•Updated 3 months ago
95];
96
97function AcademicsSection() {
98 const [selectedSection, setSelectedSection] = useState(null);
99
352`;
353
354export default async function server(request: Request): Promise<Response> {
355 return new Response(
356 `

listGuestsMainPagemain.tsx3 matches

@izabayomucyo35p•Updated 3 months ago
3import { createRoot } from "https://esm.sh/react-dom@18.2.0/client";
4
5function App() {
6 const [guests, setGuests] = useState([]);
7 const [loading, setLoading] = useState(true);
49}
50
51function client() {
52 createRoot(document.getElementById("root")).render(<App />);
53}
54if (typeof document !== "undefined") { client(); }
55
56export default async function server(request: Request): Promise<Response> {
57 const { sqlite } = await import("https://esm.town/v/stevekrouse/sqlite");
58 const KEY = "listGuestsMainPage";
tuna

tuna9 file matches

@jxnblk•Updated 1 day ago
Simple functional CSS library for Val Town

getFileEmail4 file matches

@shouser•Updated 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.