getFileEmail4 file matches
A helper function to build a file's email
tuna8 file matches
Simple functional CSS library for Val Town
AutomationFunction1 file match
trmnl_plugins2 file matches
Backend functions for TRMNL plugins
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)
4const BASE_URL = "https://va-task-tidy.web.val.run"; // Update this to your actual domain
56export async function sendEveningCheckIn(user: User, taskSet: TaskSet, responseToken: string) {
7const yesUrl = `${BASE_URL}/api/complete?token=${responseToken}&completed=true`;
8const noUrl = `${BASE_URL}/api/complete?token=${responseToken}&completed=false`;
182}
183184export async function sendMorningReminder(user: User, taskSet: TaskSet) {
185const html = `
186<!DOCTYPE html>
341}
342343export async function sendCompletionConfirmation(user: User, completed: boolean) {
344if (completed) {
345const html = `
45// User operations
6export async function createOrUpdateUser(name: string, email: string): Promise<User> {
7// Try to find existing user
8const existingUser = await sqlite.execute(
33}
3435export async function getUserByEmail(email: string): Promise<User | null> {
36const result = await sqlite.execute(
37`SELECT * FROM ${TABLE_NAMES.USERS} WHERE email = ?`,
4243// Task set operations
44export async function createTaskSet(
45userId: number,
46task1: string,
68}
6970export async function getTaskSetByUserAndDate(userId: number, date: string): Promise<TaskSet | null> {
71const result = await sqlite.execute(
72`SELECT * FROM ${TABLE_NAMES.TASK_SETS} WHERE user_id = ? AND date = ?`,
76}
7778export async function getTaskSetById(id: number): Promise<TaskSet | null> {
79const result = await sqlite.execute(
80`SELECT * FROM ${TABLE_NAMES.TASK_SETS} WHERE id = ?`,
8586// Task completion operations
87export async function createTaskCompletion(
88userId: number,
89taskSetId: number,
111}
112113export async function getCompletionByToken(token: string): Promise<TaskCompletion | null> {
114const result = await sqlite.execute(
115`SELECT * FROM ${TABLE_NAMES.COMPLETIONS} WHERE response_token = ?`,
119}
120121export async function getCompletionByUserAndDate(userId: number, date: string): Promise<TaskCompletion | null> {
122const result = await sqlite.execute(
123`SELECT * FROM ${TABLE_NAMES.COMPLETIONS} WHERE user_id = ? AND completion_date = ?`,
128129// Dashboard data
130export async function getDashboardData(userId: number): Promise<DashboardData> {
131const user = await sqlite.execute(
132`SELECT * FROM ${TABLE_NAMES.USERS} WHERE id = ?`,
182183// Get users who need evening reminders (have tasks for today but no completion record)
184export async function getUsersNeedingEveningReminder(): Promise<Array<{user: User, taskSet: TaskSet}>> {
185const today = new Date().toISOString().split('T')[0];
186
213214// Get users who need morning reminders (marked incomplete yesterday)
215export async function getUsersNeedingMorningReminder(): Promise<Array<{user: User, taskSet: TaskSet, completion: TaskCompletion}>> {
216const yesterday = new Date();
217yesterday.setDate(yesterday.getDate() - 1);