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=84&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"(2131ms)

FirstProjectmigrations.ts1 match

@MiracleSanctuaryโ€ขUpdated 1 day ago
8 * Initialize database tables
9 */
10export async function initializeDatabase() {
11 // Create job postings table
12 await sqlite.execute(`

FirstProjectREADME.md1 match

@MiracleSanctuaryโ€ขUpdated 1 day ago
19โ”‚ โ”œโ”€โ”€ database/
20โ”‚ โ”‚ โ”œโ”€โ”€ migrations.ts # Schema definitions
21โ”‚ โ”‚ โ””โ”€โ”€ queries.ts # DB query functions
22โ”‚ โ”œโ”€โ”€ routes/
23โ”‚ โ”‚ โ”œโ”€โ”€ jobs.ts # Job posting routes

JobPlatformapp.js16 matches

@MiracleSanctuaryโ€ขUpdated 2 days ago
21init();
22
23async function init() {
24 // Set view source link
25 setViewSourceLink();
41}
42
43function setViewSourceLink() {
44 // Get the current URL and convert it to Val Town URL
45 const currentUrl = window.location.href;
49
50// Event Listeners
51function setupEventListeners() {
52 // Job form submission
53 jobForm.addEventListener('submit', async (e) => {
82}
83
84// Job Functions
85async function loadJobs() {
86 try {
87 const response = await fetch('/api/jobs');
111}
112
113async function submitJobPosting() {
114 try {
115 const formData = {
148}
149
150// Chat Functions
151function enableChat() {
152 usernameContainer.innerHTML = `<p class="text-sm text-gray-600">Chatting as: <span class="font-semibold">${escapeHtml(username)}</span> <button id="change-username" class="text-blue-600 text-xs hover:underline">Change</button></p>`;
153
185}
186
187async function loadChatMessages() {
188 try {
189 const response = await fetch('/api/chat');
210}
211
212function renderChatMessages(messages) {
213 chatMessages.innerHTML = messages.map(msg => `
214 <div class="chat-message ${msg.username === username ? 'text-right' : ''}">
225}
226
227function startChatPolling() {
228 // Clear any existing interval
229 if (chatPollingInterval) {
273}
274
275async function sendChatMessage() {
276 const message = chatInput.value.trim();
277 if (!message || !username) return;
306}
307
308// Utility Functions
309function formatDate(timestamp) {
310 if (!timestamp) return 'Unknown';
311
318}
319
320function formatTime(timestamp) {
321 if (!timestamp) return '';
322
328}
329
330function escapeHtml(str) {
331 if (!str) return '';
332 return str

JobPlatformqueries.ts6 matches

@MiracleSanctuaryโ€ขUpdated 2 days ago
20
21// Job posting queries
22export async function createJob(job: JobPosting): Promise<number> {
23 const result = await sqlite.execute(
24 `INSERT INTO ${JOBS_TABLE} (title, company, description, contact)
30}
31
32export async function getJobs(): Promise<JobPosting[]> {
33 const result = await sqlite.execute(
34 `SELECT * FROM ${JOBS_TABLE} ORDER BY created_at DESC`
37}
38
39export async function getJob(id: number): Promise<JobPosting | null> {
40 const result = await sqlite.execute(
41 `SELECT * FROM ${JOBS_TABLE} WHERE id = ?`,
46
47// Chat message queries
48export async function createChatMessage(message: ChatMessage): Promise<number> {
49 const result = await sqlite.execute(
50 `INSERT INTO ${CHAT_TABLE} (username, message)
56}
57
58export async function getChatMessages(limit = 50): Promise<ChatMessage[]> {
59 const result = await sqlite.execute(
60 `SELECT * FROM ${CHAT_TABLE}
66}
67
68export async function getRecentChatMessages(
69 since: number,
70 limit = 50

JobPlatformmigrations.ts1 match

@MiracleSanctuaryโ€ขUpdated 2 days ago
8 * Run database migrations to set up the schema
9 */
10export async function runMigrations() {
11 // Create jobs table
12 await sqlite.execute(`

JobPlatformREADME.md1 match

@MiracleSanctuaryโ€ขUpdated 2 days ago
19โ”‚ โ”œโ”€โ”€ database/
20โ”‚ โ”‚ โ”œโ”€โ”€ migrations.ts # Schema definitions
21โ”‚ โ”‚ โ””โ”€โ”€ queries.ts # DB query functions
22โ”‚ โ”œโ”€โ”€ routes/ # Route modules
23โ”‚ โ”‚ โ”œโ”€โ”€ jobs.ts # Job posting endpoints

AkashREADME.md1 match

@Akashashnโ€ขUpdated 2 days ago
6
7- `types.ts` - TypeScript interfaces and types used throughout the application
8- `utils.ts` - Utility functions used by both frontend and backend
9
10## Types

AkashJobForm.tsx1 match

@Akashashnโ€ขUpdated 2 days ago
377- Design and implement new features for our web applications
378- Write clean, maintainable, and efficient code
379- Collaborate with cross-functional teams to define and implement new features
380- Troubleshoot and fix bugs in existing applications
381- Mentor junior developers and conduct code reviews`,

Akashscorer.ts5 matches

@Akashashnโ€ขUpdated 2 days ago
8 * Scores a resume against job requirements
9 */
10export function scoreResume(resume: Resume, jobRequirement: JobRequirement): ScoringResult {
11 if (!resume.parsedData) {
12 throw new Error("Resume must be parsed before scoring");
57 * Calculates skill matches between resume skills and job requirements
58 */
59function calculateSkillMatches(
60 candidateSkills: string[],
61 requiredSkills: string[],
110 * Calculates experience relevance based on job title and description
111 */
112function calculateExperienceRelevance(
113 experiences: { company: string; title: string; description: string }[],
114 jobTitle: string,
135 * Calculates education relevance (simplified)
136 */
137function calculateEducationRelevance(
138 education: { institution: string; degree: string; field?: string }[]
139): number {
166 * Uses AI to generate personalized feedback for a candidate
167 */
168export async function generateCandidateFeedback(
169 resume: Resume,
170 jobRequirement: JobRequirement,

Akashparser.ts2 matches

@Akashashnโ€ขUpdated 2 days ago
7 * Parses resume text using OpenAI to extract structured information
8 */
9export async function parseResume(resumeText: string): Promise<ParsedResumeData> {
10 try {
11 const prompt = `
85 * Extracts contact information from resume text
86 */
87export async function extractContactInfo(resumeText: string): Promise<{ name: string; email: string; phone?: string }> {
88 try {
89 const prompt = `

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.