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=2077&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 31318 results for "function"(13869ms)

OpenTownieChatInput.tsx2 matches

@k7d•Updated 2 months ago
13}
14
15export function ChatInput({
16 input,
17 handleInputChange,
128 onClick={() => {
129 const customStop = (window as any).customStopRef?.current;
130 if (typeof customStop === "function") {
131 customStop();
132 }

OpenTownieChatHeader.tsx1 match

@k7d•Updated 2 months ago
17}
18
19export function ChatHeader({
20 project,
21 bearerToken,

OpenTownieBranchControl.tsx1 match

@k7d•Updated 2 months ago
17}
18
19export function BranchControl({
20 projectId,
21 projectName,

OpenTownieApp.tsx4 matches

@k7d•Updated 2 months ago
6import { Projects } from "./Projects.tsx";
7
8function safeParse(s: string) {
9 try {
10 return JSON.parse(s);
14}
15
16export function App() {
17 const [bearerToken, setBearerToken] = useLocalStorage("bearer", "");
18 const [anthropicApiKey, setAnthropicApiKey] = useLocalStorage("anthropic_api_key", "");
20 const [project, setProject_] = useState(safeParse(projectJSON));
21
22 function setProject(p: any) {
23 setProject_(p);
24 setProjectJSON(JSON.stringify(p));
25 }
26
27 function handleLogout() {
28 setBearerToken("");
29 // Keep the anthropic API key in case the user wants to reuse it

OpenTownieapi.ts1 match

@k7d•Updated 2 months ago
1// Fetch project files from the backend
2export async function fetchProjectFiles(
3 { bearerToken, projectId, branchId }: { bearerToken: string; projectId: string; branchId?: string },
4) {

OpenTownieApiKeyWarning.tsx1 match

@k7d•Updated 2 months ago
6}
7
8export function ApiKeyWarning({ show }: ApiKeyWarningProps) {
9 if (!show) return null;
10

cheerfulTanMarmotmain.tsx1 match

@FionaZ•Updated 2 months ago
8// Fetches a random joke.
9// Fetches a random joke.
10async function fetchRandomJoke() {
11 const response = await fetch(
12 "https://official-joke-api.appspot.com/random_joke",

commentmain.tsx1 match

@soxfox42•Updated 2 months ago
5const COMMENT_WEBHOOK = Deno.env.get("COMMENT_WEBHOOK")!!;
6
7export async function comment(request: Request) {
8 let message;
9

time_walkmain.js8 matches

@artivilla•Updated 2 months ago
10let unifiedSpeed = 0.8; // Slow movement speed - this now controls everything
11
12export function setup() {
13 // Create a canvas that fills the entire screen
14 createCanvas(windowWidth, windowHeight);
26
27// Handle window resizing
28export function windowResized() {
29 resizeCanvas(windowWidth, windowHeight);
30 // Adjust comet position after resize
32}
33
34export function draw() {
35 // Create a continuously changing gradient background - simplified version
36 colorPhase += 0.005; // Slow color change speed
255}
256
257function updateComet() {
258 // Fixed position for comet head (base position, bounce is added when drawing)
259 cometPosition.x = width / 2;
280}
281
282function drawCometTrail() {
283 noStroke();
284
295}
296
297function createCometParticle() {
298 // Create particles around the current trail point rather than the comet head
299 let trailPos = cometTrail.length > 0
361}
362
363function updateParticles() {
364 // Update and remove dead particles
365 for (let i = particles.length - 1; i >= 0; i--) {
371}
372
373function drawParticles() {
374 // Draw all particles
375 for (let particle of particles) {

vitalSilverBandicootmain.tsx6 matches

@SIR_FESTUS•Updated 2 months ago
3import React, { useEffect, useState } from "https://esm.sh/react@18.2.0";
4
5function JobPostingBoard() {
6 const [jobPosts, setJobPosts] = useState([]);
7 const [newPost, setNewPost] = useState({
90}
91
92function ChatGroup() {
93 const [messages, setMessages] = useState([]);
94 const [newMessage, setNewMessage] = useState("");
151}
152
153function FindJobsPortals() {
154 const jobPortals = [
155 {
218}
219
220function App() {
221 const [activeTab, setActiveTab] = useState("jobs");
222
263}
264
265function client() {
266 createRoot(document.getElementById("root")).render(<App />);
267}
268if (typeof document !== "undefined") { client(); }
269
270export default async function server(request: Request): Promise<Response> {
271 const { sqlite } = await import("https://esm.town/v/stevekrouse/sqlite");
272 const KEY = "vitalSilverBandicoot";
tuna

tuna9 file matches

@jxnblk•Updated 1 week 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.