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%22Optional%20title%22?q=function&page=2394&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 27670 results for "function"(3882ms)

marineMoccasinLizardmain.tsx10 matches

@kazUpdated 9 months ago
28 "Have the ability to murder anyone without any consequences",
29 "Have a tight knit and loyal friend group",
30 "Have another set of eyes in the back of your head (they are fully functional)",
31 "Have a very physically attractive romantic partner",
32 "Be able to spawn pizzas by snapping your fingers (max 2 per 12 hours)",
36];
37
38function App() {
39 const [user, setUser] = useState<User | null>(null);
40 const [answers, setAnswers] = useState<Answer[]>([]);
106}
107
108function SplashScreen({ onGetStarted }: { onGetStarted: () => void }) {
109 return (
110 <div className="splash-screen">
132}
133
134function TabBar() {
135 const location = useLocation();
136 const tabs = [
163}
164
165function Game({ user, saveAnswer }: { user: User | null; saveAnswer: (answer: Answer, losingAnswer: string) => void }) {
166 const getRandomQuestion = useCallback((): Question => {
167 const availableOptions = [...ANSWER_OPTIONS];
198}
199
200function Answers(
201 { user, answers, rankings, clearAnswers }: {
202 user: User | null;
237}
238
239function Profile({ user, setUser }: { user: User | null; setUser: (user: User | null) => void }) {
240 const [username, setUsername] = useState("");
241
277}
278
279function client() {
280 createRoot(document.getElementById("root")!).render(<App />);
281}
285}
286
287async function server(request: Request): Promise<Response> {
288 const { sqlite } = await import("https://esm.town/v/stevekrouse/sqlite");
289 const KEY = "marineMoccasinLizard";
369}
370
371async function updateEloRankings(sqlite: any, KEY: string, winningAnswer: string, losingAnswer: string) {
372 const K = 32; // This is the maximum score change per match
373

RefiComparisonmain.tsx3 matches

@jbwintersUpdated 9 months ago
20}
21
22function App() {
23 const [offers, setOffers] = useState<Offer[]>([]);
24 const [newOffer, setNewOffer] = useState<Omit<Offer, 'id' | 'monthlyPayment' | 'totalInterest'>>({
354}
355
356function client() {
357 createRoot(document.getElementById("root")).render(<App />);
358}
362}
363
364async function server(request: Request): Promise<Response> {
365 const { blob } = await import("https://esm.town/v/std/blob");
366 const KEY = "RefiComparison";

extractTextmain.tsx1 match

@ttodosiUpdated 9 months ago
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export async function extractText(data, name) {
4 const fileUrl =
5 "https://www.gcmgrosvenor.com/wp-content/uploads/Private-Credit-Co-investing-GCM-Grosvenor.pdf";

smsjournalerregistrationmain.tsx3 matches

@cephalizationUpdated 9 months ago
5const relayURL = "https://cephalization-smsjournalertextrelay.web.val.run";
6
7function App() {
8 const [phoneNumber, setPhoneNumber] = useState("");
9 const [registrationKey, setRegistrationKey] = useState("");
60}
61
62function client() {
63 createRoot(document.getElementById("root")).render(<App />);
64}
65if (typeof document !== "undefined") { client(); }
66
67async function server(request: Request): Promise<Response> {
68 const sharedSecret = Deno.env.get("smsjournalersecret");
69

npmExplorermain.tsx3 matches

@allUpdated 9 months ago
98};
99
100function App() {
101 const [searchTerm, setSearchTerm] = useState("");
102 const [packages, setPackages] = useState([]);
261}
262
263function client() {
264 createRoot(document.getElementById("root")).render(<App />);
265}
267if (typeof document !== "undefined") { client(); }
268
269async function server(request: Request): Promise<Response> {
270 const url = new URL(request.url);
271

allFontmain.tsx3 matches

@allUpdated 9 months ago
36];
37
38function App() {
39 const [customText, setCustomText] = useState("abcde fghijk lmnop qrstu vwxyz");
40 const [font, setFont] = useState("all font");
107}
108
109function client() {
110 createRoot(document.getElementById("root")).render(<App />);
111}
113if (typeof document !== "undefined") { client(); }
114
115export default async function server(request: Request): Promise<Response> {
116 return new Response(
117 `

lastloginmain.tsx4 matches

@tionisUpdated 9 months ago
1/** @jsxImportSource npm:hono/jsx */
2
3async function createSession(email: string, hostname: string) {
4 const { zip } = await import("https://esm.town/v/pomdtr/sql");
5 const { sqlite } = await import("https://esm.town/v/std/sqlite");
24}
25
26async function getSession(sessionID: string, hostname: string) {
27 const { zip } = await import("https://esm.town/v/pomdtr/sql");
28 const { sqlite } = await import("https://esm.town/v/std/sqlite");
53}
54
55async function deleteSession(sessionID: string) {
56 const { sqlite } = await import("https://esm.town/v/std/sqlite");
57
65const OAUTH_COOKIE = "oauth_store";
66
67export function lastlogin(
68 handler: (req: Request) => Response | Promise<Response>,
69) {

sqliteExplorerAppREADME.md1 match

@rizoadevUpdated 9 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

aqimain.tsx1 match

@nandhinianandjUpdated 9 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 });

test_migratedmain.tsx5 matches

@jxnblkUpdated 9 months ago
2import { render } from "npm:preact-render-to-string";
3
4export function it(name, fn) {
5 const ok = "✅ [OK]: ";
6 const fail = "❌ [FAIL]: ";
15}
16
17export function describe(name, run) {
18 console.log(name);
19 return async function(req: Request): Promise<Response> {
20 await run();
21 return Response.json({ ok: true, status: 200 });
34};
35
36function Badge({ status }: BadgeProps) {
37 const color = colors[status];
38 const label = status ? status.toUpperCase() : "N/A";
68}
69
70export default async function(req: Request): Promise<Response> {
71 const params = new URL(req.url).searchParams;
72 const valURL = params.get("url");

getFileEmail4 file matches

@shouserUpdated 1 month ago
A helper function to build a file's email
tuna

tuna8 file matches

@jxnblkUpdated 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.