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=6&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 18026 results for "function"(640ms)

yc_findermain.tsx5 matches

@dbn12•Updated 5 hours ago
23`;
24
25function Hero() {
26 return (
27 <div className="hero">
32}
33
34function HowItWorks() {
35 return (
36 <div className="how-it-works">
53}
54
55function App() {
56 const [ycCompanies, setYcCompanies] = useState<YCCompany[]>([]);
57 const [mergedData, setMergedData] = useState<any[]>([]);
217}
218
219function client() {
220 createRoot(document.getElementById("root")!).render(<App />);
221}
225}
226
227export default async function server(request: Request): Promise<Response> {
228 const companies = await fetch("https://stevekrouse-yc_database.web.val.run").then(res => res.json());
229 const url = new URL(request.url);

testProj2test_http.tsx1 match

@vtTestLocal•Updated 7 hours ago
1export default async function (req: Request): Promise<Response> {
2 console.log("test");
3 return new Response(

stevensDemohandleTelegramMessage.ts5 matches

@kuanche•Updated 7 hours ago
30 * Store a chat message in the database
31 */
32export async function storeChatMessage(
33 chatId,
34 senderId,
63 * Retrieve chat history for a specific chat
64 */
65export async function getChatHistory(chatId, limit = 50) {
66 try {
67 const { sqlite } = await import("https://esm.town/v/stevekrouse/sqlite");
88 * Format chat history for Anthropic API
89 */
90function formatChatHistoryForAI(history) {
91 const messages = [];
92
112 * Analyze a Telegram message and extract memories from it
113 */
114async function analyzeMessageContent(
115 anthropic,
116 username,
487
488// Handle webhook requests
489export default async function(req: Request): Promise<Response> {
490 // Set webhook if it is not set yet
491 if (!isEndpointSet) {

FeedPondmain.js1 match

@elouan•Updated 7 hours ago
10await initializeAggregatorDB();
11
12export default async function(req: Request): Promise<Response> {
13 const url = new URL(req.url);
14 const path = url.pathname.toLowerCase();

FeedPondfrontend.js1 match

@elouan•Updated 7 hours ago
1// frontend.js
2
3export function serveFrontend(req: Request): Response {
4 const feedUrl = `https://${Deno.env.get("USER")}-${Deno.env.get("NAME")}.web.val.run/feed.xml`;
5

FeedPondreceiveCreation.js1 match

@elouan•Updated 7 hours ago
7const SHARED_SECRET = Deno.env.get("PONDIVERSE_PUSH_SECRET");
8
9export async function handleReceiveCreation(req: Request): Promise<Response> {
10 // 1. Check Method
11 if (req.method !== "POST") {

FeedPonddb.js1 match

@elouan•Updated 7 hours ago
5export const UPSTREAM_PONDIVERSE_URL = "https://pondiverse.com"; // URL for linking, not fetching
6
7export async function initializeAggregatorDB() {
8 // Store original ID to prevent duplicates, store necessary RSS fields
9 await sqlite.execute(`

FeedPondgenerateRSS.js2 matches

@elouan•Updated 7 hours ago
3
4// Helper to escape XML characters - IMPORTANT!
5function escapeXml(unsafe) {
6 if (typeof unsafe !== 'string') return '';
7 return unsafe.replace(/[<>&'"\\]/g, (c) => { // Added backslash escape
18}
19
20export async function generateRSSFeed() {
21 const feedUrl = `https://${Deno.env.get("USER")}-${Deno.env.get("NAME")}.web.val.run/feed.xml`; // Auto-detects your val URL
22 const siteUrl = "https://pondiverse.com/explore/"; // Link to the main explore page

untitled-6323new-file-8750.tsx11 matches

@wahobd•Updated 8 hours ago
3import { createRoot } from "https://esm.sh/react-dom@18.2.0/client";
4
5function Slideshow({ images }) {
6 useEffect(() => {
7 let currentSlideIndex = 0;
11 const transitionDuration = 800; // 0.8 seconds (must match CSS)
12
13 function showNextSlide() {
14 if (totalSlides <= 1) return;
15
64}
65
66function Card({ title, subtitle, amount, steps, footerSlides, buttonText, modalTitle, modalContent }) {
67 const [isModalActive, setIsModalActive] = useState(false);
68
73 let footerSlideInterval = null;
74
75 function showNextFooterSlide() {
76 footerSlideContainers.forEach((container) => {
77 const slides = container.querySelectorAll(".footer-slide");
171}
172
173function Modal({ isActive, onClose, title, content }) {
174 return (
175 <div className={`modal-overlay ${isActive ? "active" : ""}`} onClick={onClose}>
186}
187
188function InviteCard() {
189 return (
190 <div className="card invite-card">
208}
209
210function BottomNavigation() {
211 return (
212 <nav className="bottom-nav">
226}
227
228function LoadingOverlay() {
229 const [message, setMessage] = useState("");
230 const [showTryLater, setShowTryLater] = useState(true);
275}
276
277function App() {
278 const [showOverlay, setShowOverlay] = useState(false);
279
364}
365
366function client() {
367 createRoot(document.getElementById("root")).render(<App />);
368}
372}
373
374export default async function server(request: Request): Promise<Response> {
375 return new Response(
376 `

stevensDemotestDailyBrief.ts1 match

@kuanche•Updated 11 hours ago
4import { DateTime } from "https://esm.sh/luxon@3.4.4";
5
6export async function testDailyBrief() {
7 try {
8 const testChatId = Deno.env.get("TEST_TELEGRAM_CHAT_ID");

getFileEmail4 file matches

@shouser•Updated 1 week 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": "*",