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/$2?q=function&page=2390&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 28772 results for "function"(1632ms)

assertiveTanMeadowlarkmain.tsx1 match

@gwthompson•Updated 7 months ago
2import { easyAQI } from "https://esm.town/v/stevekrouse/easyAQI?v=5";
3
4export async function aqi(interval: Interval) {
5 const location = "pittsburgh"; // <-- change to place, city, or zip code
6 const data = await easyAQI({ location });

stripeCasualCheckoutDemomain.tsx3 matches

@vawogbemi•Updated 7 months ago
4import Stripe from "https://esm.sh/stripe";
5
6function App() {
7 const [loading, setLoading] = useState(false);
8 const [tipAmount, setTipAmount] = useState(5);
84}
85
86function client() {
87 createRoot(document.getElementById("root")).render(<App />);
88}
89if (typeof document !== "undefined") { client(); }
90
91export default async function server(request: Request): Promise<Response> {
92 const url = new URL(request.url);
93

passwordGenmain.tsx9 matches

@all•Updated 7 months ago
4import { createRoot } from "https://esm.sh/react-dom/client";
5
6function AlbertiCipherDisk({ outerRotation, innerRotation, onRotate }) {
7 const outerAlphabet = "ABCDEFGHILMNOPQRSTVXZ1234";
8 const innerAlphabet = "gklnprtvz&xysomqihfdbace";
80}
81
82function SecurityLevelPicker({ securityLevel, setSecurityLevel }) {
83 return (
84 <div className="flex justify-center space-x-2 mb-6">
100}
101
102function MinLengthPicker({ minLength, setMinLength }) {
103 const options = [8, 12, 16, 20];
104
122}
123
124function SpecialCharToggle({ allowedSpecial, setAllowedSpecial }) {
125 const specialChars = "!@#$%^&*()_+-=[]{}|;:,.<>?".split("");
126
152}
153
154function App() {
155 const [input, setInput] = useState("password123");
156 const [securityLevel, setSecurityLevel] = useState("medium");
397 <li>Review the generated password and its corresponding secure identifier.</li>
398 <li>
399 Utilize the "Copy" functionality to securely transfer your newly generated password to the system
400 clipboard.
401 </li>
420}
421
422function client() {
423 createRoot(document.getElementById("root")).render(<App />);
424}
428}
429
430async function server(request: Request): Promise<Response> {
431 if (request.method === "POST" && new URL(request.url).pathname === "/generate") {
432 const { input, policy, outerRotation, innerRotation } = await request.json();
506}
507
508function generatePassword(
509 input: string,
510 policy: any,

sendNtifyNotificationmain.tsx1 match

@jnv•Updated 7 months ago
14const DEFAULT_SERVER = 'https://ntfy.sh/';
15
16export async function sendNtfyNotification(payload: NtfyPayload) {
17 const { server = DEFAULT_SERVER, topic } = payload ?? {};
18

web_uVEjrAHlZHmain.tsx1 match

@dhvanil•Updated 7 months ago
1
2 export async function web_uVEjrAHlZH(req) {
3 return new Response(`<!DOCTYPE html>
4<html>

web_jvEOd6FdXLmain.tsx1 match

@dhvanil•Updated 7 months ago
1
2 export async function web_jvEOd6FdXL(req) {
3 return new Response(`<!DOCTYPE html>
4<html>

web_GgRfBRQZjpmain.tsx1 match

@dhvanil•Updated 7 months ago
1
2 export async function web_GgRfBRQZjp(req) {
3 return new Response(`<!DOCTYPE html>
4<html>

fullPageWebsiteScrapermain.tsx4 matches

@willthereader•Updated 7 months ago
418}
419
420// Main Function
421export async function findBrokenLinks(websiteUrl) {
422 console.log("Version: " + import.meta.url.match(/[?&]v=([^&]*)/)?.at(1));
423 try {
470
471// Usage
472export default async function(interval) {
473 console.log(`Starting broken link check at ${new Date().toISOString()}`);
474 const url = "https://dateme.directory";
481 console.log("External broken links:", JSON.stringify(results.brokenLinks.external, null, 2));
482 } catch (error) {
483 console.error(`Error in main function: ${error.message}`);
484 }
485}

web_AXDuIDWzNXmain.tsx1 match

@dhvanil•Updated 7 months ago
1
2 export async function web_AXDuIDWzNX(req) {
3 return new Response(`<!DOCTYPE html>
4<html>

web_mmtKPYGP3mmain.tsx1 match

@dhvanil•Updated 7 months ago
1
2 export async function web_mmtKPYGP3m(req) {
3 return new Response(`<!DOCTYPE html>
4<html>

getFileEmail4 file matches

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

tuna8 file matches

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