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=7&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 31559 results for "function"(3016ms)

baseballindex.ts7 matches

@bmitchinsonโ€ขUpdated 1 day ago
1export default async function(req: Request): Promise<Response> {
2 const html = `<!DOCTYPE html>
3<html lang="en">
230 }
231
232 function addPlayer() {
233 playerCount++;
234 const tbody = document.getElementById('scorecard-body');
253 }
254
255 function toggleCell(cell) {
256 if (cell.classList.contains('hit')) {
257 cell.classList.remove('hit');
268 }
269
270 function updateTotals() {
271 const rows = document.querySelectorAll('#scorecard-body tr');
272 let totalRuns = 0;
305 }
306
307 function clearScorecard() {
308 if (confirm('Are you sure you want to clear the entire scorecard?')) {
309 const cells = document.querySelectorAll('.scorecard-cell');
316 }
317
318 function printScorecard() {
319 window.print();
320 }
322 // Add some Cubs spirit with occasional cheers
323 let cheerCount = 0;
324 document.addEventListener('click', function() {
325 cheerCount++;
326 if (cheerCount % 20 === 0) {

baseballindex.html6 matches

@bmitchinsonโ€ขUpdated 1 day ago
177 }
178
179 function addPlayer() {
180 playerCount++;
181 const tbody = document.getElementById('scorecard-body');
199 }
200
201 function toggleCell(cell) {
202 if (cell.classList.contains('hit')) {
203 cell.classList.remove('hit');
214 }
215
216 function updateTotals() {
217 const rows = document.querySelectorAll('#scorecard-body tr');
218 let totalRuns = 0;
251 }
252
253 function clearScorecard() {
254 if (confirm('Are you sure you want to clear the entire scorecard?')) {
255 const cells = document.querySelectorAll('.scorecard-cell');
262 }
263
264 function printScorecard() {
265 window.print();
266 }
268 // Add some Cubs spirit with occasional cheers
269 let cheerCount = 0;
270 document.addEventListener('click', function() {
271 cheerCount++;
272 if (cheerCount % 20 === 0) {

factoid-triviaGameContent.tsx1 match

@bmitchinsonโ€ขUpdated 1 day ago
25}
26
27export function GameContent({
28 gameState,
29 currentUser,

factoid-triviaAdminPanel.tsx1 match

@bmitchinsonโ€ขUpdated 1 day ago
9}
10
11export function AdminPanel({
12 onKickAll,
13 isKickingAll,

factoid-triviaNameEntry.tsx1 match

@bmitchinsonโ€ขUpdated 1 day ago
8}
9
10export function NameEntry({ onJoin, isConnecting, error }: NameEntryProps) {
11 const [name, setName] = useState("");
12

factoid-triviaREADME.md5 matches

@bmitchinsonโ€ขUpdated 1 day ago
11- Name entry and user management
12- Support for up to 30 concurrent players
13- **NEW:** Complete trivia game functionality:
14 - Fact submission by each player
15 - Random fact selection for rounds
18 - Answer reveal with vote results
19 - Scoring system and leaderboard
20 - Skip functionality for rounds
21
22## How to Play
53โ”‚ โ”œโ”€โ”€ database/
54โ”‚ โ”‚ โ”œโ”€โ”€ migrations.ts # SQLite schema for users, facts, votes, rounds
55โ”‚ โ”‚ โ””โ”€โ”€ queries.ts # Database query functions for game logic
56โ”‚ โ””โ”€โ”€ routes/
57โ”‚ โ””โ”€โ”€ websocket.ts # WebSocket connection handling (future)
89- โœ… **Answer reveal and vote result display**
90- โœ… **Scoring system and leaderboard**
91- โœ… **Skip round functionality**
92- โœ… **Complete game flow from start to finish**
93
115 - Current game state
116
117โš ๏ธ **Warning**: The kick all function is irreversible and will completely reset the game to its initial state.
118

factoid-triviaUserList.tsx1 match

@bmitchinsonโ€ขUpdated 1 day ago
8}
9
10export function UserList({ users, currentUserId }: UserListProps) {
11 return (
12 <div className="usps-card">

factoid-triviaGameLobby.tsx1 match

@bmitchinsonโ€ขUpdated 1 day ago
10}
11
12export function GameLobby({
13 users,
14 currentUserId,

factoid-triviaFactEntry.tsx1 match

@bmitchinsonโ€ขUpdated 1 day ago
8}
9
10export function FactEntry({
11 onSubmitFact,
12 isSubmitting,

factoid-triviaApp.tsx1 match

@bmitchinsonโ€ขUpdated 1 day ago
22}
23
24export function App() {
25 const [gameState, setGameState] = useState<GameState>({
26 users: [],
tuna

tuna9 file matches

@jxnblkโ€ขUpdated 2 weeks ago
Simple functional CSS library for Val Town

getFileEmail4 file matches

@shouserโ€ขUpdated 2 months 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.