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/$%7BsvgDataUrl%7D?q=function&page=27&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 30772 results for "function"(2227ms)

583. **Backend Database Layer**
59 - Create `backend/database/queries.ts` with CRUD operations
60 - Implement vendor management functions
61 - Implement invoice management functions
62
63### Deliverables:
135 - Quick status updates (click to advance status)
136 - Bulk operations (select multiple invoices)
137 - Search functionality
138 - Sort by different columns
139
164 - Export invoices to CSV
165 - Import invoices from CSV
166 - Backup/restore functionality
167 - Data validation and error messages
168
199
200## Deployment Strategy
201Each phase will be deployable and functional, allowing for iterative development and testing. The admin tools will be available throughout for database management and debugging.
202```
203
227- Admin utilities for easy database management and seeding
228
229Each phase is designed to be deployable and functional on its own, so you can test and use the system as we build it incrementally. The admin tools will be available from Phase 1, making it easy to manage your data throughout development.
230
231Would you like me to start implementing Phase 1, or would you like to review/modify any part of the plan first?

api_ianmenethil_commain.tsx3 matches

@ianmenethil•Updated 1 day ago
9let initializationPromise: Promise<boolean> | null = null;
10
11async function initializeRoutes(): Promise<boolean> {
12 if (routesInitialized) {
13 return true;
48
49/**
50 * Main server function for Val.town
51 * @param request - Incoming HTTP request
52 * @returns Response object
53 */
54async function server(request: Request): Promise<Response> {
55 try {
56 if (!routesInitialized) {

Studypoor5paid.tsx4 matches

@Aditya0010•Updated 1 day ago
31];
32
33function LoginPage() {
34 const [userId, setUserId] = useState("");
35 const [password, setPassword] = useState("");
176}
177
178function DashboardApp() {
179 const [activeSubject, setActiveSubject] = useState(null);
180
232}
233
234function client() {
235 const path = window.location.pathname;
236 if (path === "/dashboard") {
242if (typeof document !== "undefined") { client(); }
243
244export default async function server(request: Request): Promise<Response> {
245 // Comprehensive user credentials
246 const validCredentials = {

invest-trackermacro_news_daily.tsx1 match

@samxii777•Updated 1 day ago
3const KEY = Deno.env.get("NEWSAPI");
4
5export default async function run() {
6 const q = encodeURIComponent(`Fed OR CPI OR inflation OR ECB OR RBA`);
7 const url = `https://newsapi.org/v2/everything?` +

honeydewmain.tsx25 matches

@legal•Updated 1 day ago
88 `;
89
90function generateHtmlShell(sourceUrl: string): string {
91 return ` 
92 <!DOCTYPE html><html lang="en"><head><meta charset="UTF-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><title>Honeydew</title>
473 <template id="review-task-template"><div class="review-task-item"><input type="text" class="review-task-content" placeholder="Task description" required><input type="date" class="review-task-due-date" title="Due Date"><select class="review-task-load" title="Cognitive Load"><option value="Low">Low</option><option value="Medium" selected>Medium</option><option value="High">High</option></select><button type="button" class="review-task-delete-btn" title="Remove Task">&times;</button></div></template> 
474 <script> 
475 (function() {
476  const API_URL = '${sourceUrl}'; 
477  const STORE_KEYS = { projects: 'honeydew_projects_v1', tasks: 'honeydew_tasks_v1', theme: 'honeydew_theme_v1' }; 
483  const genId = () => Date.now().toString(36) + Math.random().toString(36).substr(2, 9); 
484  
485  function loadState() { 
486    projects = getStore(STORE_KEYS.projects); 
487    tasks = getStore(STORE_KEYS.tasks); 
492  } 
493
494  function render() { 
495    renderSidebar(); 
496    renderTaskList(); 
498  } 
499
500  function toggleLoading(btn, show) { 
501    if (!btn) return; 
502    btn.disabled = show; 
504  } 
505  
506  function updateUIElements() { 
507    const todayStr = new Date().toISOString().split("T")[0]; 
508    const todayTasks = tasks.filter(t => !t.isCompleted && t.dueDate === todayStr); 
522  } 
523
524  function renderSidebar() { 
525    const mainViews = [ 
526      {id:'today',name:'Today',icon:'M6 2a1 1 0 00-1 1v1H4a2 2 0 00-2 2v10a2 2 0 002 2h12a2 2 0 002-2V6a2 2 0 00-2-2h-1V3a1 1 0 10-2 0v1H7V3a1 1 0 00-1-1z'}, 
531  } 
532
533  function renderTaskList() { 
534    const container = $("#task-list"); 
535    let filteredTasks = [], title = 'Tasks'; 
561  } 
562
563  function renderChatLog() { 
564    const log = $("#chat-log"); 
565    log.innerHTML = conversationHistory.map(msg => { 
632  }; 
633
634 function executeSingleCommand(command) {
635 if (!command || !command.tool_name) return;
636 if (command.tool_name === 'ask_for_confirmation') {
657 }
658
659 function executeManualCommand(command) {
660 if (Array.isArray(command)) {
661 command.forEach(c => executeSingleCommand(c));
665 }
666
667  async function handleChatSubmit(e) { 
668    e.preventDefault(); 
669    const input = $("#chat-input"), userMessage = input.value.trim(); 
713  } 
714  
715  function handleAddTask(e) { 
716    e.preventDefault(); 
717    const input = $("#new-task-input"), content = input.value.trim(); 
738  } 
739
740  function handleTaskClick(e) { 
741    const target = e.target, taskItem = target.closest(".task-item"); 
742    if (!taskItem) return; 
756  } 
757
758  function openEditModal(task) { 
759    $("#edit-task-id").value = task.id; 
760    $("#edit-task-content").value = task.content; 
765  } 
766
767  function handleUpdateTask(e) { 
768    e.preventDefault(); 
769    const taskId = $("#edit-task-id").value, task = tasks.find(t => t.id === taskId); 
777  } 
778  
779  async function triggerProjectSynthesisFromButton() { 
780    const goal = prompt("Describe your new project or goal:", "Plan a launch party for a new product"); 
781    if (!goal) return; 
794  } 
795  
796  async function triggerDailyRebalance() { 
797    const todayStr = new Date().toISOString().split("T")[0]; 
798    const todayTasks = tasks.filter(t => !t.isCompleted && t.dueDate === todayStr); 
820  } 
821
822  function handleOpenChat() { 
823    const mainInput = $('#new-task-input'); 
824    const text = mainInput.value.trim(); 
833  } 
834  
835  function addReviewTaskRow(taskData = {}) { 
836    const template = $('#review-task-template'); 
837    const clone = template.content.cloneNode(true); 
844  } 
845
846  function openProjectReviewModal(data) { 
847    const { projectName, tasks: aiTasks } = data; 
848    $('#review-project-name').value = projectName; 
855  } 
856
857  function handleProjectReviewSubmit(e) { 
858    e.preventDefault(); 
859    const projectName = $('#review-project-name').value.trim(); 
877  } 
878
879 function initTheme() {
880 const themeToggle = $('#theme-toggle');
881 const storedTheme = localStorage.getItem(STORE_KEYS.theme);
897 }
898
899  function bindEventListeners() { 
900    document.body.addEventListener('click', e => { 
901      if (e.target.closest('[data-view]')) { 
953}
954
955export default async function(req: Request): Promise<Response> {
956 const openai = new OpenAI();
957 const url = new URL(req.url);

ChatMCPClient.ts1 match

@c15r•Updated 1 day ago
491 * Register event handlers
492 */
493 on(event: MCPEventType, handler: Function): void {
494 switch (event) {
495 case "connected":

ChatEnhancedCommandPalette.tsx2 matches

@c15r•Updated 1 day ago
58}
59
60// Helper functions for JSON Schema handling
61const getDefaultValue = (schema: any): any => {
62 if (schema.default !== undefined) return schema.default;
138};
139
140export default function EnhancedCommandPalette({
141 servers,
142 query,

fart-with-aiindex.html2 matches

@sirmews•Updated 1 day ago
261 const soundWaves = document.getElementById('soundWaves');
262
263 function createSoundWave() {
264 const wave = document.createElement('div');
265 wave.className = 'wave';
271 }
272
273 function createStinkCloud() {
274 const cloud = document.createElement('div');
275 cloud.className = 'cloud';

my-first-valnew-file-1656.tsx1 match

@ccao•Updated 1 day ago
1import { OpenAI } from "https://esm.town/v/std/openai";
2
3export default async function(req: Request): Promise<Response> {
4 if (req.method === "OPTIONS") {
5 return new Response(null, {

my-first-val04_email.tsx1 match

@ccao•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) {
tuna

tuna9 file matches

@jxnblk•Updated 1 week ago
Simple functional CSS library for Val Town

getFileEmail4 file matches

@shouser•Updated 1 month ago
A helper function to build a file's email
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.