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?q=function&page=1&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 24819 results for "function"(741ms)

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

AutomationFunction1 file match

@saradp•Updated 1 month ago

TwilioHelperFunctions

@vawogbemi•Updated 3 months ago

trmnl_plugins2 file matches

@camflan•Updated 3 months ago
Backend functions for TRMNL plugins

exampleTestFunctions1 file match

@willthereader•Updated 4 months ago

generateFunction1 file match

@wolf•Updated 5 months ago

functionExercise2 file matches

@willthereader•Updated 5 months ago

FunctionToHTMLForm1 file match

@dps•Updated 1 year ago

gpt4FunctionCallingExample2 file matches

@stevekrouse•Updated 1 year ago

VA-TASK-TIDYemailService.ts3 matches

@aishatopeyemi•Updated 14 mins ago
4const BASE_URL = "https://va-task-tidy.web.val.run"; // Update this to your actual domain
5
6export async function sendEveningCheckIn(user: User, taskSet: TaskSet, responseToken: string) {
7 const yesUrl = `${BASE_URL}/api/complete?token=${responseToken}&completed=true`;
8 const noUrl = `${BASE_URL}/api/complete?token=${responseToken}&completed=false`;
182}
183
184export async function sendMorningReminder(user: User, taskSet: TaskSet) {
185 const html = `
186 <!DOCTYPE html>
341}
342
343export async function sendCompletionConfirmation(user: User, completed: boolean) {
344 if (completed) {
345 const html = `

VA-TASK-TIDYqueries.ts11 matches

@aishatopeyemi•Updated 15 mins ago
4
5// User operations
6export async function createOrUpdateUser(name: string, email: string): Promise<User> {
7 // Try to find existing user
8 const existingUser = await sqlite.execute(
33}
34
35export async function getUserByEmail(email: string): Promise<User | null> {
36 const result = await sqlite.execute(
37 `SELECT * FROM ${TABLE_NAMES.USERS} WHERE email = ?`,
42
43// Task set operations
44export async function createTaskSet(
45 userId: number,
46 task1: string,
68}
69
70export async function getTaskSetByUserAndDate(userId: number, date: string): Promise<TaskSet | null> {
71 const result = await sqlite.execute(
72 `SELECT * FROM ${TABLE_NAMES.TASK_SETS} WHERE user_id = ? AND date = ?`,
76}
77
78export async function getTaskSetById(id: number): Promise<TaskSet | null> {
79 const result = await sqlite.execute(
80 `SELECT * FROM ${TABLE_NAMES.TASK_SETS} WHERE id = ?`,
85
86// Task completion operations
87export async function createTaskCompletion(
88 userId: number,
89 taskSetId: number,
111}
112
113export async function getCompletionByToken(token: string): Promise<TaskCompletion | null> {
114 const result = await sqlite.execute(
115 `SELECT * FROM ${TABLE_NAMES.COMPLETIONS} WHERE response_token = ?`,
119}
120
121export async function getCompletionByUserAndDate(userId: number, date: string): Promise<TaskCompletion | null> {
122 const result = await sqlite.execute(
123 `SELECT * FROM ${TABLE_NAMES.COMPLETIONS} WHERE user_id = ? AND completion_date = ?`,
128
129// Dashboard data
130export async function getDashboardData(userId: number): Promise<DashboardData> {
131 const user = await sqlite.execute(
132 `SELECT * FROM ${TABLE_NAMES.USERS} WHERE id = ?`,
182
183// Get users who need evening reminders (have tasks for today but no completion record)
184export async function getUsersNeedingEveningReminder(): Promise<Array<{user: User, taskSet: TaskSet}>> {
185 const today = new Date().toISOString().split('T')[0];
186
213
214// Get users who need morning reminders (marked incomplete yesterday)
215export async function getUsersNeedingMorningReminder(): Promise<Array<{user: User, taskSet: TaskSet, completion: TaskCompletion}>> {
216 const yesterday = new Date();
217 yesterday.setDate(yesterday.getDate() - 1);
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.