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/?q=function&page=1429&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 18628 results for "function"(5661ms)

sqliteExplorerAppREADME.md1 match

@molefrog•Updated 7 months ago
33- [x] fix wonky sidebar separator height problem (thanks to @stevekrouse)
34- [x] make result tables scrollable
35- [x] add export to CSV, and JSON (CSV and JSON helper functions written in [this val](https://www.val.town/v/nbbaier/sqliteExportHelpers). Thanks to @pomdtr for merging the initial version!)
36- [x] add listener for cmd+enter to submit query

schedulermain.tsx13 matches

@elliotbraem•Updated 7 months ago
1import { sqlite } from "https://esm.town/v/stevekrouse/sqlite";
2
3export default async function server(request: Request): Promise<Response> {
4 const SCHEMA_VERSION = 15; // Increment this to create new tables
5 const KEY = "scheduler";
304 let currentCalendarEndTime = null;
305
306 function initializeDayDropdowns() {
307 const startDaySelect = document.getElementById('startDay');
308 const endDaySelect = document.getElementById('endDay');
313 }
314
315 async function loadCalendars() {
316 const response = await fetch('/calendars');
317 const calendars = await response.json();
333 }
334
335 async function createCalendar() {
336 if (!userId) {
337 alert('Please enter a name');
355
356
357 async function deleteCalendar(id) {
358 await fetch('/calendars', {
359 method: 'DELETE',
368 }
369
370 async function viewCalendar(id) {
371 currentCalendarId = id;
372 const response = await fetch('/calendars');
387 }
388
389 function createCalendarGrid() {
390 const calendar = document.getElementById('calendar');
391 calendar.innerHTML = '';
437 }
438
439 async function loadAvailability() {
440 userAvailability.clear();
441 overallAvailability = {};
460 }
461
462 async function toggleAvailability(day, time) {
463 if (!userId || !currentCalendarId) {
464 alert('Please enter your name and select a calendar first.');
491 }
492
493 function updateCalendarDisplay() {
494 for (let day = 0; day < 7; day++) {
495 for (let time = 0; time < 24 * 60; time += 30) {
516 }
517
518 function updateDebugInfo() {
519 const debugInfo = document.getElementById('debugInfo');
520 debugInfo.innerHTML = '<h3>Debug Info:</h3>';
525 }
526
527 function toggleDebugInfo() {
528 const debugInfo = document.getElementById('debugInfo');
529 const debugToggle = document.getElementById('debugToggle');
537 }
538
539 function updateDebugInfo() {
540 const debugInfo = document.getElementById('debugInfo');
541 debugInfo.innerHTML = '<h3>Debug Info:</h3>';

whatsThatAgainInHotDogsmain.tsx3 matches

@dthyresson•Updated 7 months ago
116 </table>
117 <script>
118 function calculateHotdogs() {
119 const playerName = document.getElementById('playerSelect').value;
120 fetch('/calculate?player=' + encodeURIComponent(playerName))
136 }
137
138 function highlightRow(row) {
139 // Clear previous highlights
140 const table = document.getElementById('playerInfo');
174})
175
176export default async function handler(request: Request): Promise<Response> {
177 return app.fetch(request)
178}

excaliValmain.tsx4 matches

@all•Updated 7 months ago
15};
16
17function App() {
18 const [createdValUrl, setCreatedValUrl] = useState(null);
19 const [selectedOptions, setSelectedOptions] = useState([]);
128
129const { name } = extractValInfo(import.meta.url);
130export default async function server(request: Request): Promise<Response> {
131 const excalidraw = createExcalidraw({
132 store: {
232}
233
234function client() {
235 createRoot(document.getElementById("root")).render(<App />);
236}
240}
241
242export default async function server(request: Request): Promise<Response> {
243 if (request.method === "POST" && new URL(request.url).pathname === "/create-val") {
244 const { code, name } = await request.json();

excaliValmain.tsx4 matches

@stevekrouse•Updated 7 months ago
15};
16
17function App() {
18 const [createdValUrl, setCreatedValUrl] = useState(null);
19 const [selectedOptions, setSelectedOptions] = useState([]);
128
129const { name } = extractValInfo(import.meta.url);
130export default async function server(request: Request): Promise<Response> {
131 const excalidraw = createExcalidraw({
132 store: {
232}
233
234function client() {
235 createRoot(document.getElementById("root")).render(<App />);
236}
240}
241
242export default async function server(request: Request): Promise<Response> {
243 if (request.method === "POST" && new URL(request.url).pathname === "/create-val") {
244 const { code, name } = await request.json();

blitheTomatoDragonflymain.tsx1 match

@adambuilds•Updated 7 months ago
2import { easyAQI } from "https://esm.town/v/stevekrouse/easyAQI?v=5";
3
4export async function aqi(interval: Interval) {
5 const location = "downtown brooklyn"; // <-- change to place, city, or zip code
6 const data = await easyAQI({ location });

aqimain.tsx1 match

@adambuilds•Updated 7 months ago
2import { easyAQI } from "https://esm.town/v/stevekrouse/easyAQI?v=5";
3
4export async function aqi(interval: Interval) {
5 const location = "downtown brooklyn"; // <-- change to place, city, or zip code
6 const data = await easyAQI({ location });

pushmain.tsx1 match

@jrmann100•Updated 7 months ago
88<script src="https://cdn.jsdelivr.net/gh/philfung/add-to-homescreen@1.9/dist/add-to-homescreen.min.js"></script>
89<script>
90document.addEventListener('DOMContentLoaded', function () {
91 window.AddToHomeScreenInstance = new window.AddToHomeScreen({
92 appName: 'ValPush',

todoToolsmain.tsx1 match

@romannurik•Updated 7 months ago
8)`);
9
10export default async function(request: Request) {
11 return await serveTools(request, {
12 ListTodos: {

passionateBeigeButterflyREADME.md1 match

@stevekrouse•Updated 7 months ago
33- [x] fix wonky sidebar separator height problem (thanks to @stevekrouse)
34- [x] make result tables scrollable
35- [x] add export to CSV, and JSON (CSV and JSON helper functions written in [this val](https://www.val.town/v/nbbaier/sqliteExportHelpers). Thanks to @pomdtr for merging the initial version!)
36- [x] add listener for cmd+enter to submit query
37

getFileEmail4 file matches

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

tuna8 file matches

@jxnblk•Updated 2 weeks ago
Simple functional CSS library for Val Town
webup
LangChain (https://langchain.com) Ambassador, KubeSphere (https://kubesphere.io) Ambassador, CNCF OpenFunction (https://openfunction.dev) TOC Member.
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": "*",