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=709&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 7144 results for "function"(434ms)

stripeWebsocketDemostripeTrigger1 match

@wolf•Updated 3 months ago
9);
10
11export async function trigger(req: Request): Promise<Response> {
12 const url = new URL(req.url);
13
11});
12
13function getStripeCustomer(customerId: string) {
14 return stripe.customers.retrieve(customerId);
15}

valreadmegeneratormain.tsx4 matches

@prashamtrivedi•Updated 4 months ago
4import React, { useRef, useState, useEffect } from "https://esm.sh/react@18.2.0";
5
6function App() {
7 const [username, setUsername] = useState("");
8 const [valName, setValName] = useState("");
158}
159
160function client() {
161 createRoot(document.getElementById("root")).render(<App />);
162}
163if (typeof document !== "undefined") { client(); }
164
165export default async function server(request: Request): Promise<Response> {
166 const url = new URL(request.url);
167 const parts = url.pathname.split('/').filter(Boolean);
248 });
249 } catch (error) {
250 console.error('Error in server function:', error);
251 return new Response(`Error: ${error.message}`, { status: 500 });
252 }

emilrdlemain.tsx10 matches

@stevekrouse•Updated 4 months ago
10const SOLUTION_WORDS = ["WILLY", "YOUTH", "MARRY", "METER"];
11
12function Modal({ isOpen, onClose, children }) {
13 if (!isOpen) return null;
14
22}
23
24function WinModal({ isOpen, onPlay }) {
25 return (
26 <Modal isOpen={isOpen}>
36}
37
38function ProposalModal({ isOpen }) {
39 return (
40 <Modal isOpen={isOpen}>
47}
48
49function App() {
50 const [games, setGames] = useState(SOLUTION_WORDS.map(word => ({
51 word,
188}
189
190function GameBoard(
191 {
192 word,
272}
273
274function Keyboard({ usedLetters, onKeyPress, disabled }) {
275 const rows = [
276 ["Q", "W", "E", "R", "T", "Y", "U", "I", "O", "P"],
339}
340
341function client() {
342 createRoot(document.getElementById("root")).render(<App />);
343}
345if (typeof document !== "undefined") { client(); }
346
347export default async function server(request: Request): Promise<Response> {
348 const { blob } = await import("https://esm.town/v/std/blob");
349 const wordList = await (await blob.get("quordle")).text();
393 }
394 @keyframes bounce {
395 0%, 100% { transform: translateY(-25%); animation-timing-function: cubic-bezier(0.8, 0, 1, 1); }
396 50% { transform: translateY(0); animation-timing-function: cubic-bezier(0, 0, 0.2, 1); }
397 }
398 .animate-bounce { animation: bounce 1s infinite; }

yc_findermain.tsx5 matches

@stevekrouse•Updated 5 months ago
23`;
24
25function Hero() {
26 return (
27 <div className="hero">
32}
33
34function HowItWorks() {
35 return (
36 <div className="how-it-works">
53}
54
55function App() {
56 const [ycCompanies, setYcCompanies] = useState<YCCompany[]>([]);
57 const [mergedData, setMergedData] = useState<any[]>([]);
217}
218
219function client() {
220 createRoot(document.getElementById("root")!).render(<App />);
221}
225}
226
227export default async function server(request: Request): Promise<Response> {
228 const companies = await fetch("https://stevekrouse-yc_database.web.val.run").then(res => res.json());
229 const url = new URL(request.url);

simpletextmain.tsx1 match

@nbbaier•Updated 6 months ago
84};
85
86export default async function(req: Request): Promise<Response> {
87 const url = new URL(req.url);
88 const pageKeys = (await blob.list()).filter(e => e.key.split("/")[0] === nameSpacePrefix).map(e => e.key);

XKCDComicOfTheDaymain.tsx1 match

@wolf•Updated 7 months ago
2import { load } from "npm:cheerio";
3
4export default async function(req: Request): Promise<Response> {
5 const response = await fetchText("https://xkcd.com/");
6 const $ = load(response);

cronJobToCheckCISAKEVmain.tsx2 matches

@hrbrmstr•Updated 7 months ago
5const BLOB_KEY = "seen_cves";
6
7async function checkNewVulnerabilities() {
8 const response = await fetch(KEV_URL);
9 const data = await response.json();
30}
31
32export default async function kevCron() {
33 return await checkNewVulnerabilities();
34}

knownExploitedVulnsEndpointmain.tsx1 match

@hrbrmstr•Updated 7 months ago
1export default async function server(request: Request): Promise<Response> {
2 try {
3 const response = await fetch("https://www.cisa.gov/sites/default/files/feeds/known_exploited_vulnerabilities.json");

cisaKEVToRSSmain.tsx4 matches

@hrbrmstr•Updated 7 months ago
3const RSS_FEED_URL = "https://hrbrmstr-cisakevtorss.web.val.run"; // Update this to your actual RSS feed URL
4
5function escapeXML(str: string): string {
6 return str.replace(/&/g, "&amp;")
7 .replace(/</g, "&lt;")
11}
12
13function removeInvalidXMLChars(str: string): string {
14 return str
15 .replace(/[\u0000-\u0008\u000B\u000C\u000E-\u001F]/g, "") // Control characters
19}
20
21function generateRSS(data: any): string {
22 const { title, catalogVersion, dateReleased, vulnerabilities } = data;
23
68}
69
70export async function handler(req: Request): Promise<Response> {
71 try {
72 const response = await fetch(CISA_JSON_URL);

getFileEmail4 file matches

@shouser•Updated 3 days ago
A helper function to build a file's email

TwilioHelperFunctions

@vawogbemi•Updated 2 months ago