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=2074&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 30610 results for "function"(8799ms)

determinedBrownOcelotmain.tsx3 matches

@Awash•Updated 2 months ago
12}
13
14function App() {
15 const [activities, setActivities] = useState<ClosingActivity[]>([]);
16 const [newActivity, setNewActivity] = useState<Partial<ClosingActivity>>({
134}
135
136function client() {
137 createRoot(document.getElementById("root")).render(<App />);
138}
139if (typeof document !== "undefined") { client(); }
140
141export default async function server(request: Request): Promise<Response> {
142 const { sqlite } = await import("https://esm.town/v/stevekrouse/sqlite");
143 const KEY = "determinedBrownOcelot";

jobBoardAppmain.tsx7 matches

@Tiph•Updated 2 months ago
3import { createRoot } from "https://esm.sh/react-dom@18.2.0/client";
4
5function LoginModal({ onLogin, onRegister }) {
6 const [username, setUsername] = useState("");
7 const [password, setPassword] = useState("");
75}
76
77function JobPostingForm({ onSubmit, user }) {
78 const [title, setTitle] = useState("");
79 const [company, setCompany] = useState("");
130}
131
132function JobListings() {
133 const [jobs, setJobs] = useState([]);
134
158}
159
160function ChatRoom({ user }) {
161 const [messages, setMessages] = useState([]);
162 const [newMessage, setNewMessage] = useState("");
217}
218
219function App() {
220 const [refreshJobs, setRefreshJobs] = useState(0);
221 const [user, setUser] = useState(
264}
265
266function client() {
267 createRoot(document.getElementById("root")).render(<App />);
268}
269if (typeof document !== "undefined") { client(); }
270
271export default async function server(request: Request): Promise<Response> {
272 const { sqlite } = await import("https://esm.town/v/stevekrouse/sqlite");
273 const KEY = "jobBoardApp";

calorieDeficitAppmain.tsx4 matches

@Tiph•Updated 2 months ago
3import { createRoot } from "https://esm.sh/react-dom@18.2.0/client";
4
5function CalorieDeficitGuide() {
6 const [age, setAge] = useState(25);
7 const [weight, setWeight] = useState(70);
146}
147
148function App() {
149 return <CalorieDeficitGuide />;
150}
151
152function client() {
153 createRoot(document.getElementById("root")).render(<App />);
154}
155if (typeof document !== "undefined") { client(); }
156
157export default async function server(request: Request): Promise<Response> {
158 return new Response(`
159 <html>

SQLExplorerREADME.md1 match

@ianmenethil•Updated 2 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

forlatermain.tsx4 matches

@yieldray•Updated 2 months ago
7const resend = new Resend(Deno.env.get("$resend")!);
8
9export default async function(email: Email) {
10 const { name, address } = parseOneAddress(email.from);
11 const send = (subject: string, html: string) =>
62}
63
64async function catbox(ab: ArrayBuffer, title: string): Promise<string> {
65 const fd = new FormData();
66 fd.append("reqtype", "fileupload");
70}
71
72async function wayback(url: string): Promise<string> {
73 try {
74 const u = new URL("https://httpreserve.info/save");
83}
84
85function a(href: string, text?: string) {
86 return `<a href="https://fetch1.488848.xyz/${href}">${text ?? href}</a>`;
87}

linkInBioTemplatemain.tsx1 match

@Paul_Omondi•Updated 2 months ago
2import { renderToString } from "npm:react-dom/server";
3
4export default async function(req: Request) {
5 return new Response(
6 renderToString(

delightfulHarlequinSilverfishmain.tsx3 matches

@YoungPapi•Updated 2 months ago
3import { createRoot } from "https://esm.sh/react-dom@18.2.0/client";
4
5function App() {
6 const [assignments, setAssignments] = useState([]);
7 const [messages, setMessages] = useState([]);
279};
280
281function client() {
282 createRoot(document.getElementById("root")).render(<App />);
283}
284if (typeof document !== "undefined") { client(); }
285
286export default async function server(request: Request): Promise<Response> {
287 const { sqlite } = await import("https://esm.town/v/stevekrouse/sqlite");
288 const { blob } = await import("https://esm.town/v/std/blob");

linkInBioTemplatemain.tsx1 match

@Pelzy•Updated 2 months ago
2import { renderToString } from "npm:react-dom/server";
3
4export default async function(req: Request) {
5 return new Response(
6 renderToString(

MyProjectmain.tsx5 matches

@mercyngatia•Updated 2 months ago
3import React, { useEffect, useState } from "https://esm.sh/react@18.2.0";
4
5function RoboticAvatar({ seed }: { seed: string }) {
6 const colors = ["#00FFD1", "#FF6B6B", "#4ECDC4", "#45B7D1"];
7 const hash = seed.split("").reduce((acc, char) => char.charCodeAt(0) + acc, 0);
27}
28
29function JobListingForm({ onSubmit }) {
30 const [title, setTitle] = useState("");
31 const [description, setDescription] = useState("");
98}
99
100function App() {
101 const [jobs, setJobs] = useState([]);
102 const [messages, setMessages] = useState([]);
274}
275
276function client() {
277 createRoot(document.getElementById("root")).render(<App />);
278}
279if (typeof document !== "undefined") { client(); }
280
281export default async function server(request: Request): Promise<Response> {
282 const { sqlite } = await import("https://esm.town/v/stevekrouse/sqlite");
283 const { OpenAI } = await import("https://esm.town/v/std/openai");

intuitiveGrayPikemain.tsx1 match

@mercyngatia•Updated 2 months ago
2import { renderToString } from "npm:react-dom/server";
3
4export default async function(req: Request) {
5 return new Response(
6 renderToString(
tuna

tuna9 file matches

@jxnblk•Updated 1 week 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.