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%22Image%20title%22?q=function&page=2733&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 29176 results for "function"(1908ms)

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,

get_current_weathermain.tsx1 match

@cosmo•Updated 1 year ago
1export async function getCurrentWeather(latitude = 0, longitude = 0) {
2 const pointsResponse = await fetch(`https://api.weather.gov/points/${latitude},${longitude}`),
3 { properties: { forecastHourly } } = await pointsResponse.json(),
tuna

tuna9 file matches

@jxnblk•Updated 1 day ago
Simple functional CSS library for Val Town

getFileEmail4 file matches

@shouser•Updated 1 month ago
A helper function to build a file's email
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.