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=1673&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 18579 results for "function"(4026ms)

earlyWebReturnmain.tsx2 matches

@neverstew•Updated 1 year ago
1export default async function(req: Request): Promise<Response> {
2 logTimeLater();
3 return Response.json({ time: new Date() });
4}
5
6async function logTimeLater() {
7 await new Promise((resolve) => {
8 setTimeout(() => {

sendNewsletterRemindermain.tsx1 match

@petermillspaugh•Updated 1 year ago
2import { email } from "https://esm.town/v/std/email?v=11";
3
4export async function sendNewsletterReminder(interval: Interval) {
5 // await email({
6 // subject: `Reminder to prepare newsletter #${newsletters.length + 1}`,

sendNewsletterReminderREADME.md1 match

@petermillspaugh•Updated 1 year ago
3Cousin Val to [@petermillspaugh/emailSubscription](https://www.val.town/v/petermillspaugh/emailSubscription) for emailing yourself a reminder to send your next newsletter.
4
5Since this Val is public, anyone can run it. I've commented out the function body that actually emails me to prevent anyone from spamming me, but you can fork this as a private Val to set a cron reminder.
6
7Migrated from folder: EmailSubscriptions/sendNewsletterReminder

emailSubscriptionmain.tsx1 match

@petermillspaugh•Updated 1 year ago
7import { Hono } from "npm:hono";
8
9export async function emailSubscription(req: Request) {
10 const app = new Hono();
11

moduleFetchmain.tsx1 match

@easrng•Updated 1 year ago
3let cache: [string, AuthTokens] | undefined;
4
5export function moduleFetch(input: RequestInfo | URL, init?: RequestInit | undefined): Promise<Response> {
6 const req = new Request(input, init);
7 let authTokens = Deno.env.get("DENO_AUTH_TOKENS");

january2024main.tsx2 matches

@petermillspaugh•Updated 1 year ago
2import { sqlite } from "https://esm.town/v/std/sqlite?v=4";
3
4export function getJanuary2024Newsletter() {
5 const subject = "#1 — January 2024";
6 const webUrl = "https://petemillspaugh.com/january-2024";
169}
170
171async function insertIntoNewslettersTable() {
172 const { subject, webUrl, targetSendDate } = getJanuary2024Newsletter();
173

dailySubscriptionStatsmain.tsx1 match

@petermillspaugh•Updated 1 year ago
14];
15
16export async function dailyEmailSubscriptionStats(interval: Interval) {
17 const { rows: newSubs } = await sqlite.execute(`
18 SELECT name, email

createEmailLogsmain.tsx1 match

@petermillspaugh•Updated 1 year ago
1import { sqlite } from "https://esm.town/v/std/sqlite?v=4";
2
3export async function createEmailLogsTable() {
4 await sqlite.execute(
5 `

createNewslettersmain.tsx1 match

@petermillspaugh•Updated 1 year ago
1import { sqlite } from "https://esm.town/v/std/sqlite?v=4";
2
3export async function createNewslettersTable() {
4 await sqlite.execute(
5 `

get_weather_messagemain.tsx1 match

@cosmo•Updated 1 year ago
2import { getCurrentWeather } from "https://esm.town/v/cosmo/get_current_weather";
3
4export async function getWeatherMessage(apiKey, latitude, longitude) {
5 const currentWeather = await getCurrentWeather(latitude, longitude),
6 { icon } = currentWeather,

getFileEmail4 file matches

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

tuna8 file matches

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