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=95&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 20408 results for "function"(1896ms)

react-router-data-mode-starter

react-router-data-mode-starterapi.tsx1 match

@jxnblk•Updated 2 days ago
1export default async function (req: Request): Promise<Response> {
2 // fake data API
3 return Response.json([
react-router-data-mode-starter

react-router-data-mode-starterroutes.tsx5 matches

@jxnblk•Updated 2 days ago
11const API_URL = "https://jxnblk--bc1e880c319511f0bf2d569c3dd06744.web.val.run";
12
13function HTML ({ children }: {
14 children: React.ReactNode;
15}) {
26}
27
28function Layout () {
29 return (
30 <HTML>
52}
53
54function Home () {
55 const [count, setCount] = React.useState(0);
56 return (
63}
64
65function About () {
66 const data = useLoaderData();
67
74}
75
76async function catsLoader () {
77 const data = await fetch(API_URL)
78 .then(res => res.json());

beeGPTfrontend.html13 matches

@armadillomike•Updated 2 days ago
369 <script>
370 document.addEventListener('DOMContentLoaded', () => {
371 // Tab switching functionality
372 const chatTab = document.getElementById('chat-tab');
373 const imageTab = document.getElementById('image-tab');
389 });
390
391 // Chat functionality
392 const chatForm = document.getElementById('chat-form');
393 const userInput = document.getElementById('user-input');
394 const chatContainer = document.getElementById('chat-container');
395
396 // Function to add a message to the chat
397 function addMessage(content, isUser = false) {
398 const messageDiv = document.createElement('div');
399 messageDiv.className = `message-bubble ${isUser ? 'user-message' : 'ai-message'} p-4 shadow-sm`;
403 }
404
405 // Function to show loading indicator in chat
406 function showChatLoading() {
407 const loadingDiv = document.createElement('div');
408 loadingDiv.id = 'loading-indicator';
413 }
414
415 // Function to remove loading indicator from chat
416 function hideChatLoading() {
417 const loadingIndicator = document.getElementById('loading-indicator');
418 if (loadingIndicator) {
463 });
464
465 // Image Generator functionality
466 const imageForm = document.getElementById('image-form');
467 const imagePrompt = document.getElementById('image-prompt');
477 const errorTryAgain = document.getElementById('error-try-again');
478
479 // Function to reset the image generator form
480 function resetImageGenerator() {
481 imageResult.style.display = 'none';
482 imageForm.style.display = 'block';
517 const img = new Image();
518
519 img.onload = function() {
520 // Display the generated image
521 generatedImage.src = data.imageUrl;
528 };
529
530 img.onerror = function() {
531 // Show error if image can't be loaded
532 imageLoading.style.display = 'none';
react-router-data-mode-starter

react-router-data-mode-starterhttp.tsx1 match

@jxnblk•Updated 2 days ago
11const CLIENT_MODULE = import.meta.resolve("./client.tsx");
12
13export default async function (req: Request): Promise<Response> {
14 const { query, dataRoutes } = createStaticHandler(routes);
15 const context = await query(req);

beeGPTindex.tsx2 matches

@armadillomike•Updated 2 days ago
16
17// Bee-themed image prompt enhancer
18function enhanceImagePrompt(userPrompt: string): string {
19 const prompt = userPrompt.trim();
20
39}
40
41export default async function(req: Request): Promise<Response> {
42 const url = new URL(req.url);
43

embed-servicestests.tsx1 match

@temptemp•Updated 2 days ago
1export default async function(req: Request): Promise<Response> {
2 const url = new URL(req.url);
3 url.host = `02c3dc47-4c6a-4818b-84ae-d22210c9d4cb.cloudflarepreviews.com`;

beeAiindex.ts2 matches

@armadillomike•Updated 2 days ago
16
17// Bee-themed image prompt enhancer
18function enhanceImagePrompt(userPrompt: string): string {
19 const prompt = userPrompt.trim();
20
39}
40
41export default async function(req: Request): Promise<Response> {
42 const url = new URL(req.url);
43

untitled-8878README.md1 match

@Fina•Updated 2 days ago
13## Technical Details
14
15- Built with Leaflet.js for mapping functionality
16- Uses OpenStreetMap as the base map layer
17- Styled with Tailwind CSS

untitled-8878ghana-map.ts1 match

@Fina•Updated 2 days ago
1export default async function(req: Request) {
2 // HTML content with Ghana map using Leaflet.js
3 const html = `<!DOCTYPE html>

embed-servicesmax-cron.tsx1 match

@temptemp•Updated 2 days ago
11`;
12const text = "";
13export default async function(interval: Interval) {
14 const key = "c73e2da1cd6ea3e13c52cf3b662368ed39199f6e8144facc9bd13f2da7addd30";
15 const uuid = "02c3dc47-4c6a-4818b-84ae-d22210c9d4cb";

getFileEmail4 file matches

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

tuna8 file matches

@jxnblk•Updated 3 weeks 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.