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=33&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 29123 results for "function"(777ms)

cerebras_coderindex.html1 match

@prayaas•Updated 1 day ago
19 <meta property="og:site_name" content="Cerebras Coder">
20 <meta property="og:url" content="https://cerebrascoder.com"/>
21 <meta property="og:description" content="Turn your ideas into fully functional apps in less than a second – powered by Llama3.3-70b on Cerebras's super-fast wafer chips. Code is 100% open-source, hosted on Val Town."">
22 <meta property="og:type" content="website">
23 <meta property="og:image" content="https://stevekrouse-blob_admin.web.val.run/api/public/CerebrasCoderOG.jpg">

cerebras_codergenerate-code.ts2 matches

@prayaas•Updated 1 day ago
2import STARTER_PROMPTS from "../public/starter-prompts.js";
3
4function extractCodeFromFence(text: string): string {
5 const htmlMatch = text.match(/```html\n([\s\S]*?)\n```/);
6 return htmlMatch ? htmlMatch[1].trim() : text;
7}
8
9export async function generateCode(prompt: string, currentCode: string) {
10 const starterPrompt = STARTER_PROMPTS.find(p => p.prompt === prompt);
11 if (starterPrompt) {

lotusReflectionsmain.tsx7 matches

@aidanlotus•Updated 1 day ago
11// - INTERCOM_TAG_ID_REFLECTION_USER: The ID of an Intercom tag (e.g., "reflectionFirstSubmit").
12
13// Helper function to get environment variables
14function getEnv(varName: string, optional = false): string | undefined {
15 const value = Deno.env.get(varName);
16 if (!value && !optional) {
21}
22
23// Helper function to process AI output for Notion multi-select fields
24function processMultiSelectValues(values: string | string[] | undefined | null): { name: string }[] {
25 if (!values) return [];
26 let items: string[];
34}
35
36// Helper function to normalize phone numbers
37function normalizePhoneNumber(phone: string | null | undefined): string | null {
38 if (!phone) return null;
39 let normalized = phone.replace(/[^\d+]/g, "");
46
47// --- Main HTTP Handler ---
48export default async function(req: Request): Promise<Response> {
49 console.log(`Main Submission Handler: Request received - ${req.method} ${req.url}`);
50

lotusReflectionsGetUsermain.tsx4 matches

@aidanlotus•Updated 1 day ago
1function getEnv(varName: string, optional = false): string | undefined {
2 const value = Deno.env.get(varName);
3 if (!value && !optional) {
8}
9
10// Helper function to normalize phone numbers (optional, if frontend doesn't send normalized)
11function normalizePhoneNumber(phone: string | null | undefined): string | null {
12 if (!phone) return null;
13 // Basic normalization, adjust if your format is different or frontend handles it
26 "Welcome back! We're glad to hear from you again and look forward to your latest insights.";
27
28export default async function(req: Request): Promise<Response> {
29 console.log(`getUserReflectionContext: Request received - ${req.method} ${req.url}`);
30

SON-GOKUAIToolsList.tsx1 match

@Itssongoku•Updated 1 day ago
421];
422
423export default function AIToolsList() {
424 const [searchTerm, setSearchTerm] = useState("");
425 const [selectedCategory, setSelectedCategory] = useState("All");

untitled-9865main.ts9 matches

@ruleo•Updated 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

@glance•Updated 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

@charmaine•Updated 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

@tmcw•Updated 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

@wolf•Updated 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
tuna

tuna9 file matches

@jxnblk•Updated 1 day ago
Simple functional CSS library for Val Town

getFileEmail4 file matches

@shouser•Updated 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.