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=1298&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 22493 results for "function"(2687ms)

twitterAlertmain.tsx1 match

@davincidreams•Updated 2 months ago
11const isProd = false;
12
13export async function twitterAlert({ lastRunAt }: Interval) {
14 // If isProd, search for tweets since that last time this interval ran
15 // if not, search for tweets since 48 hours ago for testing

IPE2main.tsx3 matches

@KuttyPrabhu•Updated 2 months ago
8];
9
10function App() {
11 const [selectedTemplate, setSelectedTemplate] = useState(null);
12 const [userInput, setUserInput] = useState("");
58}
59
60function client() {
61 createRoot(document.getElementById("root")).render(<App />);
62}
66}
67
68export default async function server(request: Request): Promise<Response> {
69 return new Response(`
70 <!DOCTYPE html>

twitterAlertREADME.md2 matches

@davincidreams•Updated 2 months ago
46- Key: `mentionsDiscord`
47- Value: https://discord.com/api/webhooks/1351457414179717161/wOy0KXv17LoL5mzheggEY2O0T2EZo-x_9CHhBiTB7Cr3d30JdsRSPiC1QR_nRA53nmDr
48Notifications will be sent using this function:
49
50```ts
63
64- **Proxies via Val Town's [SocialDataProxy](https://www.val.town/v/stevekrouse/socialDataProxy)**: Limited to 10 cents per day for [**Val Town Pro users**](https://www.val.town/pricing). This API is *only* for Pro users.
65- **Need more calls?** Sign up for your own [SocialData API token](https://socialdata.tools) and configure the [`socialDataSearch`](https://www.val.town/v/stevekrouse/socialDataSearch) function.

comicalGreenAnacondamain.tsx3 matches

@kaz•Updated 2 months ago
161};
162
163function App() {
164 const [player1Time, setPlayer1Time] = useState(14400); // Default 4 hours
165 const [player2Time, setPlayer2Time] = useState(14400);
295}
296
297function client() {
298 createRoot(document.getElementById("root")).render(<App />);
299}
300if (typeof document !== "undefined") { client(); }
301
302export default async function server(request: Request): Promise<Response> {
303 return new Response(`
304 <html>

AirQualityGlobeVisualizermain.tsx9 matches

@davincidreams•Updated 2 months ago
4import * as THREE from "https://esm.sh/three@0.158.0";
5
6function AirQualityGlobe() {
7 const [airQualityData, setAirQualityData] = useState([]);
8 const mountRef = useRef(null);
29
30 // Fetch air quality data from Open-Meteo
31 async function fetchAirQualityData() {
32 // Sample locations around the globe
33 const locations = [
66
67 // Create smoke plumes
68 function createSmokePlume(lat, lon, aqi) {
69 const plumeMaterial = new THREE.MeshBasicMaterial({
70 color: getAQIColor(aqi),
89
90 // AQI to color mapping
91 function getAQIColor(aqi) {
92 if (aqi <= 50) return 0x00e400; // Green
93 if (aqi <= 100) return 0xffff00; // Yellow
99
100 // Animation loop
101 function animate() {
102 requestAnimationFrame(animate);
103
109
110 // Responsive handling
111 function onWindowResize() {
112 camera.aspect = window.innerWidth / window.innerHeight;
113 camera.updateProjectionMatrix();
162}
163
164function App() {
165 return (
166 <div>
187}
188
189function client() {
190 const root = createRoot(document.getElementById("root"));
191 root.render(<App />);
194if (typeof document !== "undefined") { client(); }
195
196export default async function server(request: Request): Promise<Response> {
197 return new Response(
198 `

charlieMultiappindex.ts1 match

@dcm31•Updated 2 months ago
96
97// Questie app handler
98async function questieHandler(c: any, { appPath, query, email }: AppContext) {
99 let content;
100

charlieMultiappDetail.ts5 matches

@dcm31•Updated 2 months ago
7}
8
9export async function QuestieDetail({ email, questId }: QuestieDetailProps) {
10 // Fetch quest details from the database
11 let quest = null;
77}
78
79// Helper function to get the appropriate badge class for a status
80function getStatusBadgeClass(status: string): string {
81 switch (status.toLowerCase()) {
82 case 'completed':
93}
94
95// Helper function to format a date string
96function formatDate(dateStr: string): string {
97 if (!dateStr) return 'Unknown';
98

charlieMultiappCreate.ts1 match

@dcm31•Updated 2 months ago
5}
6
7export function QuestieCreate({ email }: QuestieCreateProps) {
8 return html`
9 <div class="questie-container">

charlieMultiappList.ts5 matches

@dcm31•Updated 2 months ago
6}
7
8export async function QuestieList({ email }: QuestieListProps) {
9 // Fetch quests from the database
10 let quests = [];
57}
58
59// Helper function to get the appropriate badge class for a status
60function getStatusBadgeClass(status: string): string {
61 switch (status.toLowerCase()) {
62 case 'completed':
73}
74
75// Helper function to format a date string
76function formatDate(dateStr: string): string {
77 if (!dateStr) return 'Unknown';
78

charlieMultiappHome.ts1 match

@dcm31•Updated 2 months ago
5}
6
7export function QuestieHome({ email }: QuestieHomeProps) {
8 return html`
9 <div class="questie-container">

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.