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=2421&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 28713 results for "function"(3981ms)

FetchBasic_deleted_1729503955main.tsx1 match

@julesb22•Updated 7 months ago
1export default async function(req: Request): Promise<Response> {
2 // Setup CORS Headers
3 const headers = new Headers();

astuteAquamarineAardvarkmain.tsx1 match

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

aqimain.tsx1 match

@jessicatheodosius•Updated 7 months ago
2import { easyAQI } from "https://esm.town/v/stevekrouse/easyAQI?v=5";
3
4export async function aqi(interval: Interval) {
5 const location = "downtown brooklyn"; // <-- change to place, city, or zip code
6 const data = await easyAQI({ location });

instantdbReactionsExamplemain.tsx6 matches

@vawogbemi•Updated 7 months ago
37 "rounded-lg bg-white p-3 text-3xl shadow-lg transition duration-200 ease-in-out hover:-translate-y-1 hover:shadow-xl";
38
39function animateEmoji(
40 config: { emoji: string; directionAngle: number; rotationAngle: number },
41 target: HTMLDivElement | null,
80}
81
82function style(el: HTMLElement, styles: Partial<CSSStyleDeclaration>) {
83 Object.assign(el.style, styles);
84}
85
86function InstantTopics() {
87 const db = init({
88 appId: "25280469-70aa-4c6e-9d47-be46e0bca539", // Replace with your actual InstantDB app ID
140}
141
142function App() {
143 return <InstantTopics />;
144}
145
146function client() {
147 createRoot(document.getElementById("root")!).render(<App />);
148}
152}
153
154export default async function server(request: Request): Promise<Response> {
155 return new Response(
156 `

simpletypemain.tsx3 matches

@dantaloupe•Updated 7 months ago
5const symbols = "!@#$%^&*()_+-=[]{}|;:,.<>?`~";
6
7function App() {
8 const [gameMode, setGameMode] = useState("words");
9 const [challenge, setChallenge] = useState("");
151}
152
153function client() {
154 createRoot(document.getElementById("root")).render(<App />);
155}
159}
160
161export default async function server(request: Request): Promise<Response> {
162 return new Response(`
163 <!DOCTYPE html>

svaltownmain.tsx4 matches

@vprtwn•Updated 7 months ago
36const TAB_UNICODE = "⇥"; // Unicode character for tab
37
38function formatTime(seconds: number): string {
39 const hrs = Math.floor(seconds / 3600);
40 const mins = Math.floor((seconds % 3600) / 60);
43}
44
45function App() {
46 const [currentWords, setCurrentWords] = useState("");
47 const [userInput, setUserInput] = useState("");
379}
380
381function client() {
382 createRoot(document.getElementById("root")).render(<App />);
383}
387}
388
389export default async function server(request: Request): Promise<Response> {
390 const url = new URL(request.url);
391

startup_clickermain.tsx4 matches

@jaredsilver•Updated 7 months ago
3import { createRoot } from "https://esm.sh/react-dom/client";
4
5function App() {
6 const [gameState, setGameState] = useState({
7 specs: 0,
287}
288
289function Store({ hireProductManager, hireSoftwareEngineer, hireDirectorOfProduct, hireDirectorOfEngineering, hireVPOfProduct, hireVPOfEngineering, runHomePageABTest, runPaywallABTest, productManagers, softwareEngineers, directorOfProduct, directorOfEngineering, vpOfProduct, vpOfEngineering, homePageABTests, paywallABTests, homePageABTestCost, paywallABTestCost, dollars }) {
290 const [activeTab, setActiveTab] = useState('recruit');
291
376}
377
378function client() {
379 createRoot(document.getElementById("root")).render(<App />);
380}
381if (typeof document !== "undefined") { client(); }
382
383export default async function server(request: Request): Promise<Response> {
384 return new Response(`
385 <html>

cabinTwitterSearchmain.tsx1 match

@jonbo•Updated 7 months ago
3import { twitterUser } from "https://esm.town/v/stevekrouse/twitterUser";
4
5export async function twitterSearch({
6 query,
7 start_time,

uptimemain.tsx1 match

@jongreer•Updated 7 months ago
6);
7
8export async function uptimeCheck(url: string) {
9 let reason: string, status: number, end: number;
10 let ok = true;

sqliteExplorerAppREADME.md1 match

@braedennorris•Updated 7 months ago
33- [x] fix wonky sidebar separator height problem (thanks to @stevekrouse)
34- [x] make result tables scrollable
35- [x] add export to CSV, and JSON (CSV and JSON helper functions written in [this val](https://www.val.town/v/nbbaier/sqliteExportHelpers). Thanks to @pomdtr for merging the initial version!)
36- [x] add listener for cmd+enter to submit query

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.