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/$%7Bart_info.art.src%7D?q=function&page=2301&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 29309 results for "function"(6016ms)

loanCalculatorAppmain.tsx4 matches

@thecybergenius•Updated 4 months ago
3import { createRoot } from "https://esm.sh/react-dom@18.2.0/client";
4
5function LoanCalculator() {
6 const [principal, setPrincipal] = useState('');
7 const [rate, setRate] = useState('');
102}
103
104function App() {
105 return <LoanCalculator />;
106}
107
108function client() {
109 createRoot(document.getElementById("root")).render(<App />);
110}
111if (typeof document !== "undefined") { client(); }
112
113export default async function server(request: Request): Promise<Response> {
114 return new Response(`
115 <html>
8const DISCORD_NOT_PLAYED_URL = process.env.DISCORD_NOT_PLAYED_URL;
9
10export default async function(interval: Interval) {
11 if (!STEAM_WEB_API_KEY || !STEAM_ID || !DISCORD_WEBSOCKET_URL || !DISCORD_NOT_PLAYED_URL) {
12 throw new Error("STEAM_WEB_API_KEY, STEAM_ID or DISCORD_WEBSOCKET_URL not set");

carRaceGame1main.tsx3 matches

@Salmannadaf1•Updated 4 months ago
3import { createRoot } from "https://esm.sh/react-dom@18.2.0/client";
4
5function CarRaceGame() {
6 const [carPosition, setCarPosition] = useState(50);
7 const [obstacles, setObstacles] = useState([]);
149};
150
151function client() {
152 createRoot(document.getElementById("root")).render(<CarRaceGame />);
153}
155if (typeof document !== "undefined") { client(); }
156
157export default async function server(request: Request): Promise<Response> {
158 return new Response(`
159 <html>

realMiningAppsmain.tsx4 matches

@Sagar445•Updated 4 months ago
4
5// Cryptocurrency Mining Simulator
6function CryptoMiningApp() {
7 const [miners, setMiners] = useState([
8 { name: "Bitcoin", hashRate: 0, power: 0, isActive: false },
130}
131
132function App() {
133 return <CryptoMiningApp />;
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) {
142 return new Response(`
143 <html>

proudMagentaTurtlemain.tsx3 matches

@Murtaza•Updated 4 months ago
36};
37
38function App() {
39 const [pdfFile, setPdfFile] = useState(null);
40 const [pdfFileName, setPdfFileName] = useState('');
245}
246
247function client() {
248 createRoot(document.getElementById("root")).render(<App />);
249}
250if (typeof document !== "undefined") { client(); }
251
252export default async function server(request: Request): Promise<Response> {
253 if (request.method === 'POST' && new URL(request.url).pathname === '/crop') {
254 try {

savvyTomatoToadmain.tsx3 matches

@yysofiyan•Updated 4 months ago
42];
43
44function App() {
45 return (
46 <div>
51}
52
53function client() {
54 createRoot(document.getElementById("root")).render(<App />);
55}
56if (typeof document !== "undefined") { client(); }
57
58export default async function server(request: Request): Promise<Response> {
59 // Handle different routes
60 const url = new URL(request.url);

discordWebhookExmain.tsx3 matches

@gigmx•Updated 4 months ago
96let monitor: PumpMonitor | null = null;
97
98function verifyDiscordRequest(request: Request): boolean {
99 const signature = request.headers.get('x-signature-ed25519');
100 const timestamp = request.headers.get('x-signature-timestamp');
108}
109
110async function handlePingCommand(): Promise<Response> {
111 let content: string;
112
133}
134
135export default async function (req: Request): Promise<Response> {
136 if (req.method !== 'POST') {
137 return new Response('Method not allowed', { status: 405 });

dynamicLavenderBeetleREADME.md1 match

@charmaine•Updated 4 months ago
63This val uses the SocialData API for Twitter data:
64- **Proxies via Val Town's SocialDataProxy**: Limited to 100 calls/day for [**Val Town Pro users**](https://www.val.town/pricing).
65- **Need more calls?** Sign up for your own [SocialData API token](https://socialdata.tools) and configure the [`socialDataSearch`](https://www.val.town/v/stevekrouse/socialDataSearch) function.

dynamicLavenderBeetlemain.tsx1 match

@charmaine•Updated 4 months ago
10const isProd = true;
11
12export async function twitterAlert({ lastRunAt }: Interval) {
13 // Scrapes data from past 48 hours time frame if testing
14 const timeFrame = isProd

hopefulApricotSparrowREADME.md1 match

@charmaine•Updated 4 months ago
63This val uses the SocialData API for Twitter data:
64- **Proxies via Val Town's SocialDataProxy**: Limited to 100 calls/day for [**Val Town Pro users**](https://www.val.town/pricing).
65- **Need more calls?** Sign up for your own [SocialData API token](https://socialdata.tools) and configure the [`socialDataSearch`](https://www.val.town/v/stevekrouse/socialDataSearch) function.
tuna

tuna9 file matches

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