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=1622&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 19289 results for "function"(1647ms)

getYenPriceCronmain.tsx2 matches

@kayla_lin•Updated 10 months ago
3import xml2js from "npm:xml2js";
4
5async function fetchHistoricData() {
6 const currentDate = new Date();
7 const promises = [];
60}
61
62export default async function(interval: Interval) {
63 const history = await fetchHistoricData();
64

qdrantmain.tsx1 match

@dglazkov•Updated 10 months ago
7} as Record<string, string>;
8
9export default async function(req: Request): Promise<Response> {
10 if (req.method === "OPTIONS") {
11 return new Response("ok", { headers: structuredClone(CORS_HEADERS) });

PGliteOldmain.tsx1 match

@samwillis•Updated 10 months ago
18})();
19
20export default async function(req: Request): Promise<Response> {
21 await init;
22 return Response.json([

uptimemain.tsx1 match

@stevekrouse•Updated 10 months ago
6);
7
8export async function uptimeCheck(url: string) {
9 let reason: string, status: number, end: number;
10 let ok = true;

status_migratedmain.tsx3 matches

@stevekrouse•Updated 10 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",

sendEmailNewslettermain.tsx1 match

@petermillspaugh•Updated 10 months ago
11];
12
13export async function sendEmailNewsletter(interval: Interval) {
14 const { jsx: newsletterContent, subject, webUrl, targetSendDate } = newsletters[newsletters.length - 1];
15

june2024main.tsx2 matches

@petermillspaugh•Updated 10 months ago
2import { sqlite } from "https://esm.town/v/std/sqlite?v=4";
3
4export function getJune2024Newsletter() {
5 const subject = "#2 — June 2024";
6 const webUrl = "https://petemillspaugh.com/june-2024";
138}
139
140async function insertIntoNewslettersTable() {
141 const { subject, webUrl, targetSendDate } = getJune2024Newsletter();
142

SolanaDeserializeUint64main.tsx2 matches

@ryoid•Updated 10 months ago
5`);
6
7function uint64(data: Uint8Array) {
8 let result = 0n;
9 for (let i = 0; i < data.length; i++) {
15console.log(uint64(input));
16
17function bytes(str: string): Uint8Array {
18 return base16.decode(str.replaceAll(/\s/g, "").toUpperCase());
19}

SolanaDeserializePublicKeymain.tsx2 matches

@ryoid•Updated 10 months ago
6`);
7
8function publicKey(data: Uint8Array) {
9 return base58.encode(data);
10}
12console.log(publicKey(input));
13
14function bytes(str: string): Uint8Array {
15 return base16.decode(str.replaceAll(/\s/g, "").toUpperCase());
16}

bookReservationOnResymain.tsx1 match

@fshine99•Updated 10 months ago
307};
308
309// To test the function
310bookReservationOnResy({
311 reservation: {

getFileEmail4 file matches

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

tuna8 file matches

@jxnblk•Updated 3 weeks ago
Simple functional CSS library for Val Town
webup
LangChain (https://langchain.com) Ambassador, KubeSphere (https://kubesphere.io) Ambassador, CNCF OpenFunction (https://openfunction.dev) TOC Member.
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": "*",