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=32&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 18880 results for "function"(1260ms)

CareerCoach20Dayanalysis.ts9 matches

@prashamtrivedi•Updated 1 day ago
15 * @returns Analysis object with summary, focus areas, and recommendations
16 */
17export async function generateDailyAnalysis() {
18 try {
19 // Get data from database for context
78 * @returns Analysis object with summary, victories, challenges, and strategy
79 */
80export async function generateWeeklyAnalysis() {
81 try {
82 // Get data from database for context
156 * @returns Array of task objects
157 */
158export async function generateTodaysTasks(analysis: any) {
159 try {
160 // Get additional context from database
213 * @returns Analysis and next steps
214 */
215export async function processLogEntry(content: any) {
216 try {
217 // Select the appropriate model based on content complexity
240}
241
242// Helper functions to generate system prompts
243
244function getSystemPromptForDailyAnalysis() {
245 return `
246 You are an elite career coach for a senior developer seeking contracts quickly.
274}
275
276function getSystemPromptForWeeklyAnalysis() {
277 return `
278 You are an elite career strategist for a senior developer seeking contracts quickly.
311}
312
313function getSystemPromptForTaskGeneration() {
314 return `
315 You are an AI career strategist for a senior developer seeking contracts quickly.
345}
346
347function getSystemPromptForLogProcessing() {
348 return `
349 You are an AI career coach providing immediate feedback on daily progress.

CareerCoach20DayREADME.md1 match

@prashamtrivedi•Updated 1 day ago
30## Tech Stack
31
32- ValTown serverless functions
33- SQLite database for persistent storage
34- OpenAI API for AI-powered analysis and recommendations

sms-email-forwardmain.tsx1 match

@jflores•Updated 1 day ago
2import process from "node:process";
3
4export default async function handler(request: Request) {
5 if (request.method !== "POST") {
6 return Response.json({ message: "This val responds to POST requests." }, {
13}
14
15export function UserProfile({ user, onUpdate }: UserProfileProps) {
16 const [username, setUsername] = useState(user.username || "");
17 const [isEditing, setIsEditing] = useState(false);
luciaMagicLinkStarter

luciaMagicLinkStarterschema.ts1 match

@stevekrouse•Updated 1 day ago
5export const MAGIC_LINKS_TABLE = "lucia_demo_magic_links_v2";
6
7async function createTables() {
8 await sqlite.execute(`
9 CREATE TABLE IF NOT EXISTS ${USER_TABLE} (
luciaMagicLinkStarter

luciaMagicLinkStarterLoginForm.tsx1 match

@stevekrouse•Updated 1 day ago
6}
7
8export function LoginForm({ onError }: LoginFormProps) {
9 const [email, setEmail] = useState("");
10 const [isSubmitting, setIsSubmitting] = useState(false);

EEPMOnitoringmediaMonitoring.tsx5 matches

@solomonferede•Updated 1 day ago
10};
11
12function MediaMonitoringTab({ user }) {
13 const [entries, setEntries] = useState([]);
14 const [platform, setPlatform] = useState("");
167 };
168
169 // Function to open the edit modal
170 const handleEditClick = (entry) => {
171 setEditingEntry(entry);
187 };
188
189 // Function to close the edit modal
190 const handleCloseEditModal = () => {
191 setIsEditModalOpen(false);
204 };
205
206 // Function to handle changes in the edit modal form
207 const handleEditFormChange = (e) => {
208 const { name, value } = e.target;
213 };
214
215 // Function to save the edited entry
216 const handleSaveEdit = async () => {
217 // Validate required fields from editFormData

my-first-val04_email.tsx1 match

@Slade_Corp•Updated 1 day ago
2// Click "Run", copy and paste the email address and send an email to it.
3// This example will log the email details received.
4export default async function emailHandler(email: Email){
5 console.log("Email received!", email.from, email.subject, email.text);
6 for (const file of email.attachments) {

my-first-val03_cron.tsx1 match

@Slade_Corp•Updated 1 day ago
2// Configure the timer with the 🕒 icon in the top right.
3// This example just logs the current time.
4export function scheduledHandler() {
5 const timestamp = new Date().toISOString();
6 console.log(`Cron val executed at: ${timestamp}`);

my-first-val02_http.tsx1 match

@Slade_Corp•Updated 1 day ago
2// Access it via its public URL (you can also pick a nicer subdomain).
3// Try adding ?name=YourName to the URL!
4export default function httpHandler(req: Request): Response {
5 const url = new URL(req.url);
6 const name = url.searchParams.get("name") || "Friend";

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
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.