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=1851&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 22731 results for "function"(1481ms)

OptimalSlogansmain.tsx1 match

@gabefletch•Updated 8 months ago
23];
24
25export default async function server(request: Request): Promise<Response> {
26 // Enable CORS for Framer
27 const headers = new Headers({

excaliEmbedmain.tsx3 matches

@all•Updated 8 months ago
3import { createRoot } from "https://esm.sh/react-dom/client";
4
5function App() {
6 return (
7 <div className="container">
25}
26
27function client() {
28 createRoot(document.getElementById("root")).render(<App />);
29}
33}
34
35export default async function server(request: Request): Promise<Response> {
36 return new Response(
37 `

addNumbersAPImain.tsx1 match

@rororowyourboat•Updated 8 months ago
1export default async function server(request: Request): Promise<Response> {
2 const url = new URL(request.url);
3 const a = Number(url.searchParams.get('a'));

returnFortyTwomain.tsx1 match

@rororowyourboat•Updated 8 months ago
1export default async function server(request: Request): Promise<Response> {
2 // Check if the request method is GET
3 if (request.method === 'GET') {

weirdOneUptimemain.tsx3 matches

@zicklag•Updated 8 months ago
5import { renderToString } from "npm:react-dom/server";
6
7function StatusRow({ rows }) {
8 return (
9 <div className="w-full flex flex-col space-y-2">
28}
29
30function StatusSection({ url, rows }) {
31 const sectionRows = rows.filter(row => row[0] === url);
32 const percentUp = Math.round((sectionRows.filter(row => row[1]).length / sectionRows.length) * 100);
44}
45
46export default async function(req: Request): Promise<Response> {
47 const { rows } = await sqlite.execute(
48 "select url, ok, duration, timestamp from uptime order by timestamp desc limit 200",

dependentHarlequinTigermain.tsx6 matches

@willthereader•Updated 8 months ago
1import puppeteer from "https://deno.land/x/puppeteer@16.2.0/mod.ts";
2
3async function scrapeForumThread(url) {
4 try {
5 const browser = await puppeteer.connect({
14 // Reveal hidden content and load tabs
15 await page.evaluate(() => {
16 // Threadmark Revealer function
17 async function clickThreadmarkButtons() {
18 let clickedButtons = new Set();
19 let totalClicked = 0;
59 }
60
61 // Tab Loader function
62 function clickTabsAndLoadContent() {
63 console.log("Starting to click tabs...");
64
85 }
86
87 // Run both functions
88 return Promise.all([clickThreadmarkButtons(), clickTabsAndLoadContent()]);
89 });

growingFuchsiaFleamain.tsx2 matches

@blindmansion•Updated 8 months ago
2 "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAApgAAAKYB3X3/OAAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAANCSURBVEiJtZZPbBtFFMZ/M7ubXdtdb1xSFyeilBapySVU8h8OoFaooFSqiihIVIpQBKci6KEg9Q6H9kovIHoCIVQJJCKE1ENFjnAgcaSGC6rEnxBwA04Tx43t2FnvDAfjkNibxgHxnWb2e/u992bee7tCa00YFsffekFY+nUzFtjW0LrvjRXrCDIAaPLlW0nHL0SsZtVoaF98mLrx3pdhOqLtYPHChahZcYYO7KvPFxvRl5XPp1sN3adWiD1ZAqD6XYK1b/dvE5IWryTt2udLFedwc1+9kLp+vbbpoDh+6TklxBeAi9TL0taeWpdmZzQDry0AcO+jQ12RyohqqoYoo8RDwJrU+qXkjWtfi8Xxt58BdQuwQs9qC/afLwCw8tnQbqYAPsgxE1S6F3EAIXux2oQFKm0ihMsOF71dHYx+f3NND68ghCu1YIoePPQN1pGRABkJ6Bus96CutRZMydTl+TvuiRW1m3n0eDl0vRPcEysqdXn+jsQPsrHMquGeXEaY4Yk4wxWcY5V/9scqOMOVUFthatyTy8QyqwZ+kDURKoMWxNKr2EeqVKcTNOajqKoBgOE28U4tdQl5p5bwCw7BWquaZSzAPlwjlithJtp3pTImSqQRrb2Z8PHGigD4RZuNX6JYj6wj7O4TFLbCO/Mn/m8R+h6rYSUb3ekokRY6f/YukArN979jcW+V/S8g0eT/N3VN3kTqWbQ428m9/8k0P/1aIhF36PccEl6EhOcAUCrXKZXXWS3XKd2vc/TRBG9O5ELC17MmWubD2nKhUKZa26Ba2+D3P+4/MNCFwg59oWVeYhkzgN/JDR8deKBoD7Y+ljEjGZ0sosXVTvbc6RHirr2reNy1OXd6pJsQ+gqjk8VWFYmHrwBzW/n+uMPFiRwHB2I7ih8ciHFxIkd/3Omk5tCDV1t+2nNu5sxxpDFNx+huNhVT3/zMDz8usXC3ddaHBj1GHj/As08fwTS7Kt1HBTmyN29vdwAw+/wbwLVOJ3uAD1wi/dUH7Qei66PfyuRj4Ik9is+hglfbkbfR3cnZm7chlUWLdwmprtCohX4HUtlOcQjLYCu+fzGJH2QRKvP3UNz8bWk1qMxjGTOMThZ3kvgLI5AzFfo379UAAAAASUVORK5CYII=";
3
4function base64ToUint8Array(base64: string): Uint8Array {
5 const binaryString = atob(base64.split(",")[1]);
6 const len = binaryString.length;
12}
13
14export default async function(req: Request): Promise<Response> {
15 const imageData = base64ToUint8Array(image);
16 return new Response(imageData, {

Badge_Generatormain.tsx3 matches

@muhammad_owais_warsi•Updated 8 months ago
4import { renderToString } from "https://esm.sh/react-dom/server";
5
6function Badge({ username, title }) {
7 return (
8 <div style={{ display: "inline-block", fontFamily: "Inter, sans-serif" }}>
38}
39
40function App() {
41 const [username, setUsername] = React.useState("");
42 const [title, setTitle] = React.useState("");
128}
129
130export default async function server(request: Request): Promise<Response> {
131 return new Response(
132 `

Whatsapp_Sendmain.tsx3 matches

@muhammad_owais_warsi•Updated 8 months ago
3import { createRoot } from "https://esm.sh/react-dom/client";
4
5function App() {
6 const [title, setTitle] = useState("");
7 const [embedCode, setEmbedCode] = useState("");
60}
61
62function client() {
63 createRoot(document.getElementById("root")).render(<App />);
64}
68}
69
70export default async function server(request: Request): Promise<Response> {
71 return new Response(
72 `

freesoundSearchmain.tsx2 matches

@sedson•Updated 8 months ago
25 * Get the nth sound for a search string.
26 */
27async function search(query: string, nth: number = 0): Promise<Sound> {
28 const queryString = qs.stringify({
29 query: query,
44}
45
46export default async function(req: Request): Promise<Response> {
47 const { pathname, searchParams } = new URL(req.url);
48 let index = parseInt(searchParams.get("i"));

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.