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=2326&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 28554 results for "function"(3632ms)

respectfulMagentaQueleamain.tsx3 matches

@azkasources•Updated 6 months ago
11}
12
13function ResearchTool() {
14 const [query, setQuery] = useState('');
15 const [results, setResults] = useState<ResearchResult | null>(null);
105}
106
107function client() {
108 createRoot(document.getElementById('root')).render(<ResearchTool />);
109}
110if (typeof document !== 'undefined') { client(); }
111
112export default async function server(request: Request): Promise<Response> {
113 // Server-side research handler
114 if (request.method === 'POST' && new URL(request.url).pathname === '/research') {

emailRandomJokemain.tsx1 match

@ManuelR_cpu•Updated 6 months ago
2
3// Fetches a random joke.
4async function fetchRandomJoke() {
5 const response = await fetch(
6 "https://official-joke-api.appspot.com/random_joke",

unbeatableWhiteAnteatermain.tsx1 match

@mihichalasani•Updated 6 months ago
2
3// Fetches a random joke.
4async function fetchRandomJoke() {
5 const response = await fetch(
6 "https://official-joke-api.appspot.com/random_joke",

DadJokesmain.tsx1 match

@aider_n•Updated 6 months ago
2
3// Fetches a random joke.
4async function fetchRandomJoke() {
5 const response = await fetch(
6 "https://official-joke-api.appspot.com/random_joke",

JokeGeneratormain.tsx2 matches

@hen1227•Updated 6 months ago
2
3// Fetches a random joke.
4async function fetchRandomJoke() {
5 const response = await fetch(
6 "https://official-joke-api.appspot.com/random_joke",
13const punchline = randomJoke.punchline;
14
15export default async function(req: Request): Promise<Response> {
16 return new Response(
17 JSON.stringify({ setup, punchline }),

festiveBlushRoundwormmain.tsx1 match

@abrarnafiu1•Updated 6 months ago
5// Fetches a random joke.
6// Fetches a random joke.
7async function fetchRandomJoke() {
8 const response = await fetch(
9 "https://official-joke-api.appspot.com/random_joke",

MultiEncryptionKeyGeneratormain.tsx9 matches

@heltonteixeira•Updated 6 months ago
4import { md5 } from "https://esm.sh/js-md5";
5
6// Helper function for SHA-256 encryption
7async function sha256(message: string) {
8 const msgBuffer = new TextEncoder().encode(message);
9 const hashBuffer = await crypto.subtle.digest('SHA-256', msgBuffer);
12}
13
14// Helper function for Base64 encoding
15function base64Encode(input: string): string {
16 return btoa(input);
17}
18
19// Custom Caesar Cipher encryption
20function caesarCipher(input: string, shift: number = 3): string {
21 return input
22 .split('')
41
42// Custom XOR Encryption
43function xorEncrypt(input: string, key: string = 'SECRET'): string {
44 return input
45 .split('')
52}
53
54function App() {
55 const [input, setInput] = useState('');
56 const [hashedValue, setHashedValue] = useState('');
279}
280
281function client() {
282 createRoot(document.getElementById("root")).render(<App />);
283}
284if (typeof document !== "undefined") { client(); }
285
286export default async function server(request: Request): Promise<Response> {
287 return new Response(`
288 <html>

ThankYouNoteGeneratormain.tsx6 matches

@willthereader•Updated 6 months ago
2import { createRoot } from "https://esm.sh/react-dom/client";
3
4function ThankYouCard({ note, theme, font, recipientName, senderName }) {
5 const [firstHalf, secondHalf] = splitNote(note);
6
27}
28
29function splitNote(note) {
30 const words = note.split(" ");
31 const midpoint = Math.ceil(words.length / 2);
36}
37
38function capitalizeName(name) {
39 if (!name) return "";
40 return name
47}
48
49function App() {
50 const [recipientName, setRecipientName] = useState("");
51 const [senderName, setSenderName] = useState("");
292}
293
294function client() {
295 createRoot(document.getElementById("root")).render(<App />);
296}
300}
301
302export default async function server(request: Request): Promise<Response> {
303 console.log(`Received ${request.method} request to ${request.url}`);
304

accomplishedBeigeGuineafowlmain.tsx1 match

@kakomam•Updated 6 months ago
1async function fetchRandomJoke() {
2 const response = fetch(
3 "https://official-joke-api.appspot.com/random_joke",

fullWebsiteCheckermain.tsx5 matches

@willthereader•Updated 6 months ago
457}
458
459// Main Function
460export async function findBrokenLinks(websiteUrl, maxDepth = 5) {
461 try {
462 console.log(`Starting link check for ${websiteUrl}`);
488}
489
490function App() {
491 const [url, setUrl] = useState("");
492 const [results, setResults] = useState(null);
678}
679
680function client() {
681 createRoot(document.getElementById("root")).render(<App />);
682}
690let progressUpdateCount = 0;
691
692export default async function server(request: Request): Promise<Response> {
693 const url = new URL(request.url);
694

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.