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=2122&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 22587 results for "function"(1668ms)

parsePacoExmain.tsx1 match

@stevekrouse•Updated 1 year ago
3export const parsePacoEx = (async () => {
4 var pako = await import("npm:pako");
5 function decodeMermaid(encodedString) {
6 var binaryData = Buffer.from(encodedString, "base64");
7 var inflatedString = pako.inflate(binaryData, { to: "string" });

qrmain.tsx2 matches

@stevekrouse•Updated 1 year ago
1import { Buffer } from "node:buffer";
2
3export async function qr(req: express.Request, res: express.Response) {
4 if (req.path.startsWith("/qr")) {
5 const { qrcode } = await import("https://deno.land/x/qrcode/mod.ts");
20 let img = document.getElementsByTagName("img")[0]
21 let input = document.getElementsByTagName("input")[0]
22 input.addEventListener('input', function(e){
23 img.src="/qr?data=" + e.target.value
24 })

callGoogleSheetsAPImain.tsx1 match

@clayway•Updated 1 year ago
7 data: object;
8};
9export async function callGoogleSheetsAPI(
10 { serviceAccount, sheetId, action, data }: Args,
11) {

nearestOpenStationmain.tsx1 match

@tmcw•Updated 1 year ago
4 lon = +lon;
5 lat = +lat;
6 function dist(station) {
7 return Math.sqrt(
8 Math.pow(station.lat - lat, 2) + Math.pow(station.lon - lon, 2)

getDuckDBmain.tsx1 match

@tmcw•Updated 1 year ago
2
3export let getDuckDB = (async () => {
4 async function createWorker(url: string) {
5 const workerScript = await fetch(url);
6 const workerURL = URL.createObjectURL(await workerScript.blob());

valTownStyleGuideUpdatedmain.tsx1 match

@stevekrouse•Updated 1 year ago
2import { hasValTownStyleGuideUpdated } from "https://esm.town/v/stevekrouse/hasValTownStyleGuideUpdated";
3
4export async function valTownStyleGuideUpdated({ lastRunAt }) {
5 if (await hasValTownStyleGuideUpdated(lastRunAt))
6 email({

myApimain.tsx1 match

@raymondcamden•Updated 1 year ago
1export function myApi(name, color = "blue") {
2 return `Hello ${name}, your favorite color is ${color}.`;
3}

myApimain.tsx1 match

@ianjkaplan•Updated 1 year ago
1export function myApi(name) {
2 return "hi " + name;
3}
1let { familyhistorycounter } = await import("https://esm.town/v/politelyinvinciblepointer/familyhistorycounter");
2
3export function increasefamilyhistorycounter() {
4 familyhistorycounter++;
5}

fetchWeatherPredictionmain.tsx1 match

@jamiedubs•Updated 1 year ago
14 };
15 }
16 async function fetchForecast(
17 latitude: number,
18 longitude: number,

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.