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/?q=function&page=1492&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 17292 results for "function"(1123ms)

latLngOfCityREADME.md1 match

@jdan•Updated 1 year ago
1Migrated from folder: openai_function_calling/latLngOfCity

weatherBotREADME.md1 match

@jdan•Updated 1 year ago
1Migrated from folder: openai_function_calling/weatherBot

tree_valmain.tsx1 match

@pomdtr•Updated 1 year ago
1import { TreeItem } from "https://esm.town/v/pomdtr/tree_types";
2
3export function valItem({ author, name }: { author: string; name: string }): TreeItem {
4 return {
5 title: name,

twitterAlertmain.tsx1 match

@mimos•Updated 1 year ago
4const query = "\"val.town\" OR \"val town\" -_ValTown_";
5
6export async function twitterAlert({ lastRunAt }: Interval) {
7 const results = await twitterSearch({
8 query,

FunctionToHTMLFormmain.tsx4 matches

@dps•Updated 1 year ago
1import { valForm } from "https://esm.town/v/rodrigotello/valForm";
2import { multiplicationFunctionTest } from "https://esm.town/v/rodrigotello/multiplicationFunctionTest";
3
4export async function FunctionToHTMLForm(
5 req: express.Request,
6 res: express.Response,
7) {
8 let myFunctionValAsHTML = multiplicationFunctionTest; // Insert your function here and it should generate an HTML form
9 return res.send(`${valForm(myFunctionValAsHTML)}`);
10}

BlueCardChangeDetectormain.tsx1 match

@callumrollo•Updated 1 year ago
6const dateChangedKey = "work-permit-change-date";
7
8export default async function(interval: Interval) {
9 const page = await fetch(site).then(res => res.text());
10 const date = page.match(/Last updated: <time datetime="([^"]+)">/)?.[1].toString();

key_value_apimain.tsx1 match

@mjweaver01•Updated 1 year ago
14});
15
16app.post("/", async function(c) {
17 let res = await sqlite.execute({
18 sql: `insert into kv(key, value) values (:key, :value)`,

dailyStandupBotmain.tsx1 match

@re757575•Updated 1 year ago
1import { discordWebhook } from "https://esm.town/v/stevekrouse/discordWebhook";
2
3export default async function() {
4 discordWebhook({
5 url: Deno.env.get("engDiscord"),

isTripleWhaleDownHourlymain.tsx1 match

@weaverwhale•Updated 1 year ago
1import isMyWebsiteDown from "https://esm.town/v/weaverwhale/isMyWebsiteDown";
2
3export default async function(interval: Interval) {
4 const data = await isMyWebsiteDown("https://app.triplewhale.com");
5 console.log(data);

cron2main.tsx2 matches

@stevekrouse•Updated 1 year ago
63
64// convert a timezone string like America/New_York to "EST"
65function shortenTimezoneString(timeZone: string) {
66 const string = new Date().toLocaleString("en-US", { timeZone, timeZoneName: "short" });
67 return string.split(" ").at(-1);
76};
77
78export async function compile(description: string, timezone: string) {
79 const { content } = await chat([
80 {

getFileEmail4 file matches

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

tuna8 file matches

@jxnblk•Updated 1 week 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": "*",