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=2327&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 28558 results for "function"(3975ms)

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

scraper_templateREADME.md1 match

@resat•Updated 6 months ago
133. Adjust the if statement to detect changes and update your blob
14
154. Craft a message to be sent with `sendNotification()` function

classicIvoryFrogmain.tsx1 match

@apulza•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",

vitalCoralWormmain.tsx1 match

@sgupta16•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",

niceCyanHummingbirdmain.tsx1 match

@tran_wesley•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",

industriousPinkMongoosemain.tsx1 match

@debbie•Updated 6 months ago
16}
17
18export default async function forwardEmail(incomingEmail: Email) {
19 try {
20 // Extract the Val Town email address

forwardermain.tsx4 matches

@debbie•Updated 6 months ago
6import { AttachmentData, email } from "https://esm.town/v/std/email";
7
8function App() {
9 const [valEmail, setValEmail] = useState<string | null>(null);
10 const [personalEmail, setPersonalEmail] = useState('');
152};
153
154function client() {
155 createRoot(document.getElementById("root")).render(<App />);
156}
157if (typeof document !== "undefined") { client(); }
158
159export default async function server(request: Request): Promise<Response> {
160 const { author, name } = extractValInfo(import.meta.url);
161
204}
205
206export async function forwarder(e: Email) {
207 const { author, name } = extractValInfo(import.meta.url);
208 let attachments: AttachmentData[] = [];

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.