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=75&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 20183 results for "function"(2064ms)

JobPlatformapp.js16 matches

@MiracleSanctuaryโ€ขUpdated 1 day 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 1 day 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 1 day 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 1 day 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 1 day 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 1 day 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 1 day 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 1 day 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 = `

Akashdatabase.ts9 matches

@Akashashnโ€ขUpdated 1 day 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 1 day 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) + '...';

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.