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/$2?q=function&page=2434&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 28846 results for "function"(9188ms)

instantdbCursorsDemomain.tsx4 matches

@vawogbemi•Updated 7 months ago
7 "flex h-screen w-screen items-center justify-center overflow-hidden font-mono text-sm text-gray-800 touch-none";
8
9function InstantCursorsProvider(props: { children: JSX.Element }) {
10 const db = init({
11 appId: "25280469-70aa-4c6e-9d47-be46e0bca539", // ADD YOUR APP ID HERE
29}
30
31function App() {
32 return (
33 <div className="flex h-screen w-screen items-center justify-center bg-gray-100">
40}
41
42function client() {
43 createRoot(document.getElementById("root")).render(
44 <InstantCursorsProvider>
52}
53
54export default async function server(request: Request): Promise<Response> {
55 return new Response(
56 `

instantCursorsDemomain.tsx4 matches

@vawogbemi•Updated 7 months ago
4import { createRoot } from "https://esm.sh/react-dom/client";
5
6function InstantCursors() {
7 const db = init<
8 {},
32}
33
34function App() {
35 return (
36 <div className="min-h-screen bg-red-100 flex items-center justify-center">
43}
44
45function client() {
46 createRoot(document.getElementById("root")).render(<App />);
47}
49if (typeof document !== "undefined") { client(); }
50
51export default async function server(request: Request): Promise<Response> {
52 return new Response(
53 `

FetchBasicmain.tsx1 match

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

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>
tuna

tuna9 file matches

@jxnblk•Updated 5 hours 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.