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/$2?q=function&page=4&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 23725 results for "function"(886ms)

untitled-4952rfpage2.ts2 matches

@nhh•Updated 4 hours ago
1export default async function(req: Request): Promise<Response> {
2 const html = `<!DOCTYPE html>
3<html lang="en">
137 <h2 style="color: #2c3e50; margin-bottom: 20px;">Page 2 Content</h2>
138 <p class="placeholder-text">
139 This page is ready for your content. Please provide the information you'd like to include here, and I'll implement it with the same professional design and functionality.
140 </p>
141 <p class="placeholder-text" style="margin-top: 15px; font-style: italic; color: #7f8c8d;">

untitled-4952rfpage1.ts5 matches

@nhh•Updated 4 hours ago
1export default async function(req: Request): Promise<Response> {
2 const html = `<!DOCTYPE html>
3<html lang="en">
231 <script>
232 // Add smooth scrolling and interactive elements
233 document.addEventListener('DOMContentLoaded', function() {
234 // Add hover effects to feature cards
235 const cards = document.querySelectorAll('.feature-card');
236 cards.forEach(card => {
237 card.addEventListener('mouseenter', function() {
238 this.style.transform = 'translateY(-5px)';
239 });
240
241 card.addEventListener('mouseleave', function() {
242 this.style.transform = 'translateY(0)';
243 });
247 const navBtns = document.querySelectorAll('.nav-btn');
248 navBtns.forEach(btn => {
249 btn.addEventListener('click', function() {
250 this.style.transform = 'scale(0.95)';
251 setTimeout(() => {

untitled-4952index.ts8 matches

@nhh•Updated 4 hours ago
1export default async function(req: Request): Promise<Response> {
2 const html = `<!DOCTYPE html>
3<html lang="en" dir="ltr">
228 <p>Phonetic disparities further compound the linguistic challenges faced by Arabic speakers. The English sound system includes a broader range of consonants and vowels than Arabic, which has only three primary vowel sounds and lacks certain consonants like /p/, /v/, /tʃ/, and /dʒ/. Consequently, Arabic learners frequently encounter difficulties pronouncing these unfamiliar sounds.</p>
229
230 <p>For example, the absence of /p/ in Arabic often results in its substitution with /b/, leading to mispronunciations such as "bark" instead of "park." Similarly, the voiced /v/ sound may be replaced with its voiceless counterpart /f/, causing errors like "ferry" instead of "very". To compensate for these gaps, learners often resort to repair strategies, such as substituting similar-sounding letters or omitting challenging sounds altogether. For instance, the /tʃ/ sound in "church" might be reduced to /ʃ/, resulting in "shurch". These adaptations, while functional, can hinder intelligibility and necessitate targeted phonetic training.</p>
231 </section>
232
415
416 <script>
417 function showEnglish() {
418 document.getElementById('english-content').classList.remove('hidden');
419 document.getElementById('arabic-content').classList.add('hidden');
424 }
425
426 function showArabic() {
427 document.getElementById('arabic-content').classList.remove('hidden');
428 document.getElementById('english-content').classList.add('hidden');
434
435 // Add smooth scrolling and interactive elements
436 document.addEventListener('DOMContentLoaded', function() {
437 // Add hover effects to content sections
438 const sections = document.querySelectorAll('.content-section');
439 sections.forEach(section => {
440 section.addEventListener('mouseenter', function() {
441 this.style.transform = 'translateY(-5px)';
442 });
443
444 section.addEventListener('mouseleave', function() {
445 this.style.transform = 'translateY(0)';
446 });
450 const toggleBtns = document.querySelectorAll('.toggle-btn');
451 toggleBtns.forEach(btn => {
452 btn.addEventListener('click', function() {
453 this.style.transform = 'scale(0.95)';
454 setTimeout(() => {

untitled-2461project-ring-image.tsx1 match

@syskaul•Updated 4 hours ago
1export default async function(req: Request): Promise<Response> {
2 // Handle CORS preflight
3 if (req.method === 'OPTIONS') {

spreadchatsheets-import.ts4 matches

@twitchard•Updated 4 hours ago
1// This file would contain the actual Google Sheets import functionality
2// For a complete implementation, we would need to:
3// 1. Use the Google Sheets API to fetch sheet data
8// using the Google Sheets API and SheetJS for data conversion
9
10export async function importFromGoogleSheets(sheetUrl: string) {
11 try {
12 // Extract the sheet ID from the URL
51}
52
53// Helper function to extract sheet ID from Google Sheets URL
54function extractSheetId(url: string): string | null {
55 try {
56 // Google Sheets URLs are typically in the format:

scrape-amazon-reviewsindex.ts6 matches

@metaphysics0•Updated 4 hours ago
17}
18
19// Helper function to extract product ID from Amazon URL
20function extractProductId(url: string): string | null {
21 const patterns = [
22 /\/dp\/([A-Z0-9]{10})/,
32}
33
34// Helper function to convert reviews to CSV
35function reviewsToCSV(reviews: Review[]): string {
36 const headers = ['Title', 'Rating', 'Author', 'Date', 'Content', 'Verified Purchase'];
37 const csvRows = [headers.join(',')];
52}
53
54// Helper function to scrape reviews from Amazon
55async function scrapeAmazonReviews(productId: string, maxPages: number = 5): Promise<Review[]> {
56 const reviews: Review[] = [];
57 const userAgent = 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36';

x402-democlient.tsx1 match

@stevedylandev•Updated 5 hours ago
9const url = "https://stevedylandev--100deaa43be911f0af859e149126039e.web.val.run/joke";
10
11async function main() {
12 const response = await fetchWithPayment(url);
13 if (!response.ok) {

tourguideTourGuide.tsx1 match

@neverstew•Updated 5 hours ago
11}
12
13export default function TourGuide({
14 itinerary,
15 progress,

tourguideItineraryView.tsx1 match

@neverstew•Updated 5 hours ago
10}
11
12export default function ItineraryView({ itinerary, onStartTour, onBack, isOffline }: ItineraryViewProps) {
13 const [selectedStop, setSelectedStop] = useState<TourStop | null>(null);
14

tourguideSearchForm.tsx1 match

@neverstew•Updated 5 hours ago
12}
13
14export default function SearchForm({
15 onItineraryGenerated,
16 onViewItinerary,

getFileEmail4 file matches

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

tuna8 file matches

@jxnblk•Updated 1 month 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.