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=1091&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 17296 results for "function"(2018ms)

KPoolCafeGameMenumain.tsx3 matches

@Kpool•Updated 3 months ago
3import React, { useEffect, useRef, useState } from "https://esm.sh/react@18.2.0";
4
5function App() {
6 const [selectedCategory, setSelectedCategory] = useState("cafe");
7 const [playerName, setPlayerName] = useState("");
394};
395
396function client() {
397 createRoot(document.getElementById("root")).render(<App />);
398}
399if (typeof document !== "undefined") { client(); }
400
401export default async function server(request: Request): Promise<Response> {
402 // Server-side code remains the same as in the previous implementation
403 const { sqlite } = await import("https://esm.town/v/stevekrouse/sqlite");

astuteYellowDeermain.tsx12 matches

@vesty91•Updated 3 months ago
57
58// Service page components (unchanged)
59function DiagnosticGratuitPage() {
60 return (
61 <div className="service-page">
81}
82
83function NettoyageOptimisationPage() {
84 return (
85 <div className="service-page">
107}
108
109function ReparationMateriellePage() {
110 return (
111 <div className="service-page">
132}
133
134function SauvegardeRecuperationPage() {
135 return (
136 <div className="service-page">
156}
157
158function InstallationLogiciellePage() {
159 return (
160 <div className="service-page">
186}
187
188function SupportDistancePage() {
189 return (
190 <div className="service-page">
210}
211
212function TarifSystemesExploitationPage() {
213 return (
214 <div className="service-page">
301}
302
303function HomePage() {
304 const [showWelcome, setShowWelcome] = useState(true);
305 const [services, setServices] = useState([
362}
363
364function App() {
365 const [isMobileMenuOpen, setIsMobileMenuOpen] = useState(false);
366 const [activeDropdown, setActiveDropdown] = useState<string | null>(null);
452}
453
454function client() {
455 createRoot(document.getElementById("root")).render(<App />);
456}
457if (typeof document !== "undefined") { client(); }
458
459export default async function server(request: Request): Promise<Response> {
460 return new Response(`
461 <html>
479}
480
481function getCss() {
482 return `
483 * {

criticEmailmain.tsx2 matches

@paulkinlan•Updated 3 months ago
5import { OpenAI } from "npm:openai";
6
7function stripHtmlBackticks(html: string): string {
8 return html.replace(/^```html\n?/, "").replace(/\n?```$/, "");
9}
10
11export default async function(e: Email) {
12 const openai = new OpenAI();
13 console.log(`from: ${e.from} to: ${e.to} subject: ${e.subject}, cc: ${e.cc}, bcc: ${e.bcc}`);

SKHomesTenantManagementmain.tsx2 matches

@skhomes•Updated 3 months ago
5// [Previous code remains unchanged]
6
7export default async function server(request: Request): Promise<Response> {
8 const { sqlite } = await import("https://esm.town/v/stevekrouse/sqlite");
9 const KEY = "SKHomesTenantManagement";
10 const SCHEMA_VERSION = 3;
11
12 // CSS definition moved inside the server function
13 const css = `
14 body {

LifeLogFitbitAuthorizemain.tsx1 match

@snowypowers•Updated 3 months ago
9 * Visit this url to get authorized for lifelog to collect data.
10 */
11export default async function(req: Request): Promise<Response> {
12 console.log(`verifier: ${verifier}`);
13 blob.set(`fibit_state_${state}`, verifier);
15
16// Wallet Connection Hook
17function usePhantomWallet() {
18 const [wallet, setWallet] = useState(null);
19 const [connected, setConnected] = useState(false);
47
48// Main Application Component
49function TokenBoostApp() {
50 const { wallet, connected, connectWallet, disconnectWallet } = usePhantomWallet();
51 const [boostAmount, setBoostAmount] = useState(100);
201
202// Client-side rendering
203function client() {
204 createRoot(document.getElementById("root")).render(<TokenBoostApp />);
205}
208
209// Server-side handler
210export default async function server(request: Request): Promise<Response> {
211 if (request.method === 'POST') {
212 const body = await request.json();

spontaneousAmaranthFinchmain.tsx1 match

@mattrw2•Updated 3 months ago
4const datePattern = /\b[A-Za-z]{3}\s\d{1,2}\b/;
5
6export default async function(interval: Interval) {
7 const response = await fetch("https://www.sperrychalet.com/vacancy_s.html");
8 const body = await response.text();

comicalBlackRattlesnakemain.tsx1 match

@Rajnish•Updated 3 months ago
1export default async function(e: rajnishbhojpur99@gmail.coml) {
2}

labUploadDeletemain.tsx1 match

@todepond•Updated 3 months ago
2import { sqlite } from "https://esm.town/v/stevekrouse/sqlite";
3
4export default async function(req: Request): Promise<Response> {
5 let json;
6 try {

dotcommain.tsx1 match

@blotre•Updated 3 months ago
14const dateClass = "text-xs text-gray-400 font-mono mr-1 hidden sm:inline-block";
15
16async function getHits() {
17 const [, , { rows: [[monthHits]] }, { rows: [[todayHits]] }] = await sqlite.batch([
18 "CREATE TABLE IF NOT EXISTS stevekrouse_com_hits (timestamp DATETIME DEFAULT CURRENT_TIMESTAMP)",

getFileEmail4 file matches

@shouser•Updated 1 week ago
A helper function to build a file's email
tuna

tuna8 file matches

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