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=32&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 29111 results for "function"(871ms)

SON-GOKUAIToolsList.tsx1 match

@ItssongokuUpdated 23 hours ago
421];
422
423export default function AIToolsList() {
424 const [searchTerm, setSearchTerm] = useState("");
425 const [selectedCategory, setSelectedCategory] = useState("All");

untitled-9865main.ts9 matches

@ruleoUpdated 1 day ago
71 const MAX_DATA_POINTS = 60;
72
73 function initChart() {
74 const ctx = chartCanvas.getContext('2d');
75 chart = new Chart(ctx, {
109 }
110
111 async function measurePing() {
112 const startTime = performance.now();
113 packetCounter++;
127 }
128
129 function updateUI(rtt, label) {
130 currentRttEl.textContent = rtt !== null ? rtt : 'Lost';
131 if (rtt !== null) {
150 }
151
152 function resetTest() {
153 pingData = [];
154 packetCounter = 0;
161 }
162
163 function startTest() {
164 isTesting = true;
165 toggleButton.textContent = 'Stop Test';
169 }
170
171 function stopTest() {
172 isTesting = false;
173 toggleButton.textContent = 'Start Test';
181
182// The main React component for the page
183function ConnectionTesterPage() {
184 return (
185 <html>
263}
264
265// The default export for Val Town: a function that handles HTTP requests.
266export default async function(req: Request) {
267 // Render the React component to an HTML string.
268 const pageHtml = renderToString(<ConnectionTesterPage />);

Teamcron.ts1 match

@glanceUpdated 1 day ago
1import { getDatabasePageIds, getValTownUser, setNotionPage } from "./controllers/controllers.ts";
2
3export default async function(interval: Interval) {
4 const pages = await getDatabasePageIds();
5 // loop through the database

displaymain.tsx1 match

@charmaineUpdated 1 day ago
1export default async function (req: Request): Promise<Response> {
2 return new Response(`Hellom XYZ\n${Date.now() % 100000000}`, {
3 headers: {

displaymain.tsx1 match

@tmcwUpdated 1 day ago
1export default async function (req: Request): Promise<Response> {
2 return new Response(`Hellom XYZ\n${Date.now() % 100000000}`, {
3 headers: {

scrapetestREADME.md1 match

@wolfUpdated 1 day ago
7- **Flight Search Form** - Enter origin, destination, and travel dates
8- **Real-time Results** - Display scraped flight information in a user-friendly format
9- **Export Functionality** - Download results as JSON for further analysis
10- **Error Handling** - Clear error messages and loading states
11- **Responsive Design** - Works on desktop and mobile devices

scrapetestscraper.ts8 matches

@wolfUpdated 1 day ago
1import { FlightSearchParams, FlightResult, ScrapingResult } from "../shared/types.ts";
2
3export async function scrapeFlights(params: FlightSearchParams): Promise<ScrapingResult> {
4 const { origin, destination, departDate, returnDate } = params;
5
57}
58
59async function scrapeFrontierDirect(params: FlightSearchParams): Promise<ScrapingResult> {
60 const searchUrl = buildFrontierSearchUrl(params);
61 console.log(`Direct search URL: ${searchUrl}`);
88}
89
90async function scrapeFrontierMainPage(params: FlightSearchParams): Promise<ScrapingResult> {
91 console.log("Trying main page approach...");
92
120}
121
122async function generateSampleData(params: FlightSearchParams): Promise<ScrapingResult> {
123 console.log("Generating sample data as fallback...");
124
198}
199
200function buildFrontierSearchUrl(params: FlightSearchParams): string {
201 // Try multiple URL patterns that Frontier might use
202 const patterns = [
218}
219
220function parseFlightData(html: string): FlightResult[] {
221 const flights: FlightResult[] = [];
222
261}
262
263function parseJsonFlightData(data: any[]): FlightResult[] {
264 const flights: FlightResult[] = [];
265
294}
295
296function parseHtmlFlightData(html: string): FlightResult[] {
297 const flights: FlightResult[] = [];
298

scrapetestapp.js12 matches

@wolfUpdated 1 day ago
1let currentResults = null;
2
3document.addEventListener('DOMContentLoaded', function() {
4 const searchForm = document.getElementById('searchForm');
5 const searchBtn = document.getElementById('searchBtn');
14 document.getElementById('departDate').value = tomorrow.toISOString().split('T')[0];
15
16 searchForm.addEventListener('submit', async function(e) {
17 e.preventDefault();
18
28 });
29
30 exportBtn.addEventListener('click', function() {
31 if (currentResults) {
32 downloadJSON(currentResults, `frontier-flights-${Date.now()}.json`);
34 });
35
36 async function searchFlights(params) {
37 try {
38 showLoading();
65 }
66
67 function displayResults(data) {
68 const resultsContent = document.getElementById('resultsContent');
69
160 }
161
162 function showLoading() {
163 loading.classList.remove('hidden');
164 searchBtn.disabled = true;
166 }
167
168 function hideLoading() {
169 loading.classList.add('hidden');
170 searchBtn.disabled = false;
172 }
173
174 function showResults() {
175 results.classList.remove('hidden');
176 }
177
178 function hideResults() {
179 results.classList.add('hidden');
180 }
181
182 function showError(message) {
183 document.getElementById('errorMessage').textContent = message;
184 error.classList.remove('hidden');
185 }
186
187 function hideError() {
188 error.classList.add('hidden');
189 }
190
191 function downloadJSON(data, filename) {
192 const blob = new Blob([JSON.stringify(data, null, 2)], { type: 'application/json' });
193 const url = URL.createObjectURL(blob);
1function sendNotification() {
2 const TOKEN = process.env.TELEGRAM_BOT_TOKEN;
3 const CHAT_ID = 1825527066;
26 * Главная функция cron-триггера
27 */
28export default async function() {
29 sendNotification();
30}

EEPPortalweeklyReport.tsx6 matches

@solomonferedeUpdated 1 day ago
246};
247
248function WeeklyReportTab() {
249 // State for the detailed report (news and media)
250 const [detailedReport, setDetailedReport] = useState(null);
290 const [selectedContent, setSelectedContent] = useState("");
291
292 // Function to fetch the detailed report
293 const fetchDetailedReport = async () => {
294 setDetailedReport(null); // Clear previous detailed data while fetching
303 };
304
305 // Function to fetch the weekly summary report with custom days
306 const fetchWeeklySummary = async (days = 7) => {
307 setWeeklySummary(null); // Clear previous summary data while fetching
455 }, [weeklySummary]);
456
457 // Function to handle click on author name in Weekly Summary
458 const handleAuthorClick = (authorId, authorFullName) => {
459 if (!detailedReport || !detailedReport.newsArticles || !detailedReport.mediaEntries) {
482 };
483
484 // Function to close the author detail modal
485 const handleCloseAuthorDetailModal = () => {
486 setIsAuthorDetailModalOpen(false);
490 };
491
492 // Helper function for CSV export
493 const exportToCSV = (data, filename) => {
494 if (!data || data.length === 0) {
tuna

tuna9 file matches

@jxnblkUpdated 1 day ago
Simple functional CSS library for Val Town

getFileEmail4 file matches

@shouserUpdated 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.