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/$%7Bsuccess?q=function&page=85&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 20274 results for "function"(1309ms)

Akashdatabase.ts9 matches

@Akashashn•Updated 2 days ago
7
8// Initialize database tables
9export async function initDatabase() {
10 // Create resumes table
11 await sqlite.execute(`
37
38// Resume operations
39export async function saveResume(resume: Resume): Promise<number> {
40 const { candidateName, email, phone, resumeText, parsedData, score, createdAt } = resume;
41
59}
60
61export async function getResume(id: number): Promise<Resume | null> {
62 const result = await sqlite.execute(
63 `SELECT * FROM ${RESUMES_TABLE} WHERE id = ?`,
82}
83
84export async function getAllResumes(): Promise<Resume[]> {
85 const result = await sqlite.execute(`SELECT * FROM ${RESUMES_TABLE} ORDER BY createdAt DESC`);
86
97}
98
99export async function updateResumeScore(id: number, score: number): Promise<void> {
100 await sqlite.execute(
101 `UPDATE ${RESUMES_TABLE} SET score = ? WHERE id = ?`,
104}
105
106export async function updateParsedData(id: number, parsedData: ParsedResumeData): Promise<void> {
107 await sqlite.execute(
108 `UPDATE ${RESUMES_TABLE} SET parsedData = ? WHERE id = ?`,
112
113// Job requirement operations
114export async function saveJobRequirement(job: JobRequirement): Promise<number> {
115 const { title, description, requiredSkills, preferredSkills, minimumExperience, createdAt } = job;
116
133}
134
135export async function getJobRequirement(id: number): Promise<JobRequirement | null> {
136 const result = await sqlite.execute(
137 `SELECT * FROM ${JOB_REQUIREMENTS_TABLE} WHERE id = ?`,
155}
156
157export async function getAllJobRequirements(): Promise<JobRequirement[]> {
158 const result = await sqlite.execute(`SELECT * FROM ${JOB_REQUIREMENTS_TABLE} ORDER BY createdAt DESC`);
159

Akashutils.ts6 matches

@Akashashn•Updated 2 days ago
1// Shared utility functions for both frontend and backend
2
3/**
5 * Simple implementation for demonstration purposes
6 */
7export function calculateSimilarity(str1: string, str2: string): number {
8 const s1 = str1.toLowerCase();
9 const s2 = str2.toLowerCase();
27 * Formats a date string to a readable format
28 */
29export function formatDate(dateString: string): string {
30 if (!dateString) return '';
31
45 * Validates an email address
46 */
47export function isValidEmail(email: string): boolean {
48 const emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
49 return emailRegex.test(email);
54 * This is a simple implementation - in production, you'd use NLP
55 */
56export function extractSkills(text: string, skillsList: string[]): string[] {
57 const textLower = text.toLowerCase();
58 return skillsList.filter(skill =>
64 * Truncates text to a specified length
65 */
66export function truncateText(text: string, maxLength: number): string {
67 if (text.length <= maxLength) return text;
68 return text.substring(0, maxLength) + '...';

AkashREADME.md1 match

@Akashashn•Updated 2 days ago
27└── shared/
28 ├── types.ts # Shared type definitions
29 └── utils.ts # Utility functions
30```
31

linkInBioTemplatemain.tsx1 match

@xiezhifeng1978•Updated 2 days ago
2import { renderToString } from "npm:react-dom/server";
3
4export default async function(req: Request) {
5 return new Response(
6 renderToString(

TestREADME.md6 matches

@Anie_keme•Updated 2 days ago
9- **Church Information**: Dedicated About page with vision and mission statements
10- **Department Showcase**: Detailed information about church departments (Choir, Media Tech, Ushering, Evangelism, Home Cell)
11- **Sermon Archive**: Access to recorded sermons with playback functionality
12- **Live Streaming**: Built-in live stream player for church services
13- **Mobile-Friendly**: Fully responsive design that works on all devices
30- Modern font pairing (Inter and Playfair Display)
31- Font Awesome icons for visual elements
32- YouTube embed for live streaming functionality
33- Mobile menu with toggle functionality
34- Interactive sermon player with modal functionality
35
36## Customization
522. Set up live streaming on your YouTube channel
533. Replace "EXAMPLE_CHANNEL_ID" in the iframe src with your actual YouTube channel ID
544. Test the live stream functionality before going live
55
56## Contact Form
57
58The contact form is set up for demonstration purposes. To make it functional:
59
601. Add form submission handling code

Testindex.ts1 match

@Anie_keme•Updated 2 days ago
1// Church Website - Main Entry Point
2export default async function(req: Request) {
3 const url = new URL(req.url);
4 const path = url.pathname;

embed-servicesembed-cron.tsx1 match

@temptemp•Updated 2 days ago
11`;
12const text = "";
13export default async function(interval: Interval) {
14 const key = "fa6c59cba4de673c53b811075d3f53eae25e6d6b76db1fc70e303a6999189557";
15 const uuid = "9f3d2109-a7ca-462ff-c2f6-280023caf17f";

untitled-7719new-file-4085.tsx1 match

@Nixee•Updated 2 days ago
1export default async function (req: Request): Promise<Response> {
2 return Response.json({ ok: true })
3}

CarRentalREADME.md1 match

@Chandan5689•Updated 2 days ago
16
171. **Home**: Landing page with hero section, featured cars, and key benefits
182. **Cars**: Browse all available cars with filtering and search functionality
193. **Car Detail**: Detailed information about a specific car
204. **Booking**: Multi-step booking process

CarRentalcars.js4 matches

@Chandan5689•Updated 2 days ago
138 fuelType: 'Petrol',
139 seats: 4,
140 description: 'The iconic Porsche 911 continues to set the standard for sports cars. With its distinctive design, exceptional performance, and everyday usability, it\'s the perfect blend of form and function.',
141 features: [
142 'Sport Chrono Package',
259];
260
261// Function to get car by ID
262export const getCarById = (id) => {
263 return cars.find(car => car.id === parseInt(id));
264};
265
266// Function to filter cars by category
267export const getCarsByCategory = (category) => {
268 if (!category || category === 'All') return cars;
276};
277
278// Function to search cars
279export const searchCars = (query) => {
280 if (!query) return cars;

getFileEmail4 file matches

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

tuna8 file matches

@jxnblk•Updated 3 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.