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/image-url.jpg%20%22Image%20title%22?q=function&page=2036&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 30749 results for "function"(4045ms)

OpenTownieBranchControl.tsx1 match

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

OpenTownieApp.tsx4 matches

@jxnblk•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

@jxnblk•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

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

timelinePlayerList.tsx1 match

@tmcw•Updated 2 months ago
8}
9
10export function PlayerList({ players, onDeletePlayer }: PlayerListProps) {
11 const [deletingId, setDeletingId] = useState<string | null>(null);
12

illustriousPurpleWildebeestindex.ts4 matches

@shouser•Updated 2 months ago
3import React, { useCallback, useEffect, useRef, useState } from "https://esm.sh/react@18.2.0";
4
5function ShaderRenderer({ vertexShader, fragmentShader, animated = false, width = "100%", height = "200px" }) {
6 const canvasRef = useRef(null);
7 const [error, setError] = useState(null);
240
241// Rest of the code remains the same as in the previous implementation
242function App() {
243 const [shaders, setShaders] = useState([]);
244 const [username, setUsername] = useState("");
324}
325
326function client() {
327 createRoot(document.getElementById("root")).render(<App />);
328}
329if (typeof document !== "undefined") { client(); }
330
331export default async function server(request: Request): Promise<Response> {
332 const { sqlite } = await import("https://esm.town/v/stevekrouse/sqlite");
333 const KEY = new URL(import.meta.url).pathname.split("/").at(-1);

timelineDebugInfo.tsx1 match

@tmcw•Updated 2 months ago
2import React, { useState } from "https://esm.sh/react@18.2.0?dev";
3
4export function DebugInfo() {
5 const [isOpen, setIsOpen] = useState(false);
6 const [logs, setLogs] = useState<string[]>([]);
reactstream

reactstreamdemo.http.tsx1 match

@jxnblk•Updated 2 months ago
2import { render, React } from "https://esm.town/v/jxnblk/reactstream/index.tsx";
3
4function App() {
5 const [count, setCount] = React.useState(0);
6

timelineHeader.tsx1 match

@tmcw•Updated 2 months ago
2import React from "https://esm.sh/react@18.2.0?dev";
3
4export function Header() {
5 return (
6 <header className="mb-8">

timelineHomePage.tsx1 match

@tmcw•Updated 2 months ago
9}
10
11export function HomePage({ onNavigateToGame }: HomePageProps) {
12 const [games, setGames] = useState<Game[]>([]);
13 const [loading, setLoading] = useState(true);
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.