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%22Optional%20title%22?q=function&page=101&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 20865 results for "function"(1939ms)

Appkyqueries.ts14 matches

@OssyNachโ€ขUpdated 3 days ago
4
5// User queries
6export async function getUserByEmail(email: string): Promise<User | null> {
7 const result = await sqlite.execute(
8 `SELECT * FROM ${USERS_TABLE} WHERE email = ?`,
13}
14
15export async function getUserById(id: number): Promise<User | null> {
16 const result = await sqlite.execute(
17 `SELECT * FROM ${USERS_TABLE} WHERE id = ?`,
22}
23
24export async function createUser(user: Omit<User, 'id' | 'created_at'>): Promise<number> {
25 const result = await sqlite.execute(
26 `INSERT INTO ${USERS_TABLE} (email, password_hash, name, preferences)
34
35// Agency queries
36export async function getAllAgencies(): Promise<Agency[]> {
37 const result = await sqlite.execute(`SELECT * FROM ${AGENCIES_TABLE}`);
38 return result.rows as Agency[];
39}
40
41export async function getAgencyById(id: number): Promise<Agency | null> {
42 const result = await sqlite.execute(
43 `SELECT * FROM ${AGENCIES_TABLE} WHERE id = ?`,
49
50// Travel package queries
51export async function getAllPackages(limit = 20, offset = 0): Promise<TravelPackage[]> {
52 const result = await sqlite.execute(
53 `SELECT p.*, a.name as agency_name
62}
63
64export async function getPackageById(id: number): Promise<TravelPackage | null> {
65 const result = await sqlite.execute(
66 `SELECT p.*, a.name as agency_name
74}
75
76export async function searchPackages(params: SearchParams): Promise<TravelPackage[]> {
77 let query = `
78 SELECT p.*, a.name as agency_name
126}
127
128export async function getFeaturedPackages(limit = 6): Promise<TravelPackage[]> {
129 const result = await sqlite.execute(
130 `SELECT p.*, a.name as agency_name
141
142// Booking queries
143export async function createBooking(booking: Omit<Booking, 'id' | 'booking_date'>): Promise<number> {
144 const result = await sqlite.execute(
145 `INSERT INTO ${BOOKINGS_TABLE} (
162}
163
164export async function getBookingById(id: number): Promise<Booking | null> {
165 const result = await sqlite.execute(
166 `SELECT b.*, p.title as package_title, p.destination, p.image_url, p.start_date, p.end_date
174}
175
176export async function getUserBookings(userId: number): Promise<Booking[]> {
177 const result = await sqlite.execute(
178 `SELECT b.*, p.title as package_title, p.destination, p.image_url, p.start_date, p.end_date
187}
188
189export async function updateBookingStatus(id: number, status: string, paymentId?: string): Promise<boolean> {
190 const updateFields = paymentId
191 ? `status = ?, payment_id = ?, payment_status = 'completed'`
207
208// Update available spots when booking is confirmed
209export async function updatePackageAvailability(packageId: number, travelerCount: number): Promise<boolean> {
210 const result = await sqlite.execute(
211 `UPDATE ${PACKAGES_TABLE}

Appkymigrations.ts2 matches

@OssyNachโ€ขUpdated 3 days ago
7export const BOOKINGS_TABLE = "travel_bookings_v1";
8
9export async function runMigrations() {
10 // Users table
11 await sqlite.execute(`
76}
77
78async function insertSampleData() {
79 // Check if we already have sample data
80 const agencyCount = await sqlite.execute(`SELECT COUNT(*) as count FROM ${AGENCIES_TABLE}`);

AppkyREADME.md3 matches

@OssyNachโ€ขUpdated 3 days ago
17โ”‚ โ”œโ”€โ”€ database/
18โ”‚ โ”‚ โ”œโ”€โ”€ migrations.ts # Schema definitions
19โ”‚ โ”‚ โ””โ”€โ”€ queries.ts # DB query functions
20โ”‚ โ”œโ”€โ”€ routes/ # API route handlers
21โ”‚ โ”‚ โ”œโ”€โ”€ agencies.ts # Agency-related endpoints
31โ”‚ โ”‚ โ”œโ”€โ”€ Header.tsx # Navigation header
32โ”‚ โ”‚ โ”œโ”€โ”€ PackageCard.tsx # Travel package display card
33โ”‚ โ”‚ โ”œโ”€โ”€ SearchForm.tsx # Search functionality
34โ”‚ โ”‚ โ””โ”€โ”€ BookingFlow.tsx # Booking and payment process
35โ”‚ โ”œโ”€โ”€ index.html # Main HTML template
37โ””โ”€โ”€ shared/
38 โ”œโ”€โ”€ types.ts # Shared type definitions
39 โ””โ”€โ”€ utils.ts # Shared utility functions
40```
41

LiveStormMCPREADME.md1 match

@supagroovaโ€ขUpdated 3 days ago
21
22- `index.ts`: Main entry point with HTTP trigger
23- `livestormApi.ts`: Functions to fetch and parse the OpenAPI definition
24- `mcp.ts`: MCP server setup and configuration

redditwatcherREADME.md2 matches

@jollyโ€ขUpdated 3 days ago
42 - Value: Your SERP API key.
43
44Without this key, the val will not function correctly.
45
46---
58- Key: `mentionsDiscord`
59- Value: Your Discord webhook URL.
60Notifications will be sent using this function:
61```
62 await discordWebhook({

redditwatchermain.tsx1 match

@jollyโ€ขUpdated 3 days ago
12const isProd = true;
13
14export async function redditAlert({ lastRunAt }: Interval) {
15 if (!SERP_API_KEY || !DISCORD_API_KEY) {
16 console.error("Missing SERP_API_KEY or Discord webhook URL. Exiting.");

templateRedditAlertREADME.md2 matches

@jollyโ€ขUpdated 3 days ago
42 - Value: Your SERP API key.
43
44Without this key, the val will not function correctly.
45
46---
58- Key: `mentionsDiscord`
59- Value: Your Discord webhook URL.
60Notifications will be sent using this function:
61```
62 await discordWebhook({

templateRedditAlertmain.tsx1 match

@jollyโ€ขUpdated 3 days ago
12const isProd = true;
13
14export async function redditAlert({ lastRunAt }: Interval) {
15 if (!SERP_API_KEY || !DISCORD_API_KEY) {
16 console.error("Missing SERP_API_KEY or Discord webhook URL. Exiting.");

EEPPortaltaskDashboard.tsx4 matches

@solomonferedeโ€ขUpdated 3 days ago
119 const [isChangingStatus, setIsChangingStatus] = useState<number | null>(null);
120
121 // --- Function: Fetch Employees ---
122 // This is needed for the Assignee/Manager dropdowns in create/edit forms and the assignee filter (for admin)
123 const fetchEmployees = async () => {
215 }, []);
216
217 // --- Helper function to get employee name by ID ---
218 const employeeMap = useMemo(() => {
219 const map = new Map<number, Employee>();
534 };
535
536 // Handler function for selecting a task to view details
537 const handleTaskSelect = (task: Task) => {
538 if (editingTask) {
547 };
548
549 // Handler function for closing the task details view
550 const handleCloseDetails = () => {
551 setSelectedTask(null);

untitled-9291Footer.tsx1 match

@maria26โ€ขUpdated 3 days ago
17 <h3 className="text-xl font-semibold mb-4">IDES INTERIOR</h3>
18 <p className="text-gray-400 mb-4">
19 Creating beautiful, functional spaces that enhance people's lives.
20 </p>
21 {projectInfo.url && (

getFileEmail4 file matches

@shouserโ€ขUpdated 3 weeks ago
A helper function to build a file's email
tuna

tuna8 file matches

@jxnblkโ€ขUpdated 4 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.