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?q=function&page=18&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 28949 results for "function"(852ms)

intentionally-errormain.tsx1 match

@shouser•Updated 17 hours ago
1import { ValTown } from "npm:";
2
3export function hi() {
4 return "hi";
5}

parquetmain.tsx2 matches

@maxm•Updated 17 hours ago
7
8
9export default async function (req: Request): Promise<Response> {
10 // Get URL info
11 const url = new URL(req.url);
109 * Handle proxy requests to the parquet host
110 */
111async function handleProxyRequest(
112 req: Request,
113 path: string,
jsx

jsxdemo-023 matches

@jxnblk•Updated 17 hours ago
18 transitionProperty: "background-color, color",
19 transitionDuration: "1s",
20 transitionTimingFunction: "ease-in-out",
21 "&:hover": {
22 backgroundColor: "magenta",
34};
35
36function App () {
37 return (
38 <html>
53}
54
55export default async function (req: Request): Promise<Response> {
56 const html = renderToString(<App />);
57 return new Response(html, {
jsx

jsxjsx-runtime1 match

@jxnblk•Updated 17 hours ago
43}
44
45export function jsxs (type: ElementType<any, keyof JSX.IntrinsicElements>, props: SXProps|null, key?: Key) {
46 return jsx(type, props, key);
47}

TownieMessages.tsx9 matches

@valdottown•Updated 17 hours ago
23});
24
25export function Messages ({
26 messages,
27 messageEndTimes,
58}
59
60function Message ({
61 message,
62 messageEndTimes,
86}
87
88function AssistantMessage ({ message, messageEndTimes, running }: {
89 message: Message;
90 messageEndTimes: Record<string, number>;
107}
108
109function Part ({ part }) {
110 switch (part.type) {
111 case "text":
122}
123
124function TextPart ({ part }) {
125 return (
126 <ReactMarkdown>
130}
131
132function Details ({ open, onClick, children, summary }) {
133 return (
134 <details
148}
149
150function ToolPart ({ part }) {
151 const { openSummaries, setOpenSummaries } = useContext(MessageContext);
152 const {
312}
313
314function EditorToolPart ({ part }) {
315 const { openSummaries, setOpenSummaries } = useContext(MessageContext);
316 const {
379}
380
381function UserMessage ({ message }: {
382 message: Message;
383}) {

parquetduckdb.html4 matches

@maxm•Updated 17 hours ago
114
115 // Sanitize error messages to remove any sensitive information
116 function sanitizeErrorMessage(message) {
117 if (!message) return "Unknown error";
118
125 }
126
127 function addQuery(id, sql) {
128 const container = document.createElement('div');
129 container.className = 'query';
146 }
147
148 function showTable(el, columns, rows) {
149 if (rows.length === 0) {
150 el.innerHTML = '<span class="success">No results</span>';
171 }
172
173 (async function() {
174 try {
175 // Initialize DuckDB

boggleSolverTowniemain.tsx5 matches

@alexwein•Updated 18 hours ago
16}
17
18function buildTrie(words: string[]): TrieNode {
19 const root = new TrieNode();
20 for (const word of words) {
31}
32
33function findBoggleWords(board: { x: number; y: number; letter: string }[], wordList: string[]): string[] {
34 const trie = buildTrie(wordList);
35 const foundWords = new Set<string>();
49 ];
50
51 function isValidCell(x: number, y: number): boolean {
52 return x >= 0 && x < cols && y >= 0 && y < rows;
53 }
54
55 function dfs(x: number, y: number, node: TrieNode, visited: Set<string>, currentWord: string) {
56 // Out of bounds or already visited cell
57 const cellKey = `${x},${y}`;
93}
94
95export default function boggleSolver(
96 board: { x: number; y: number; letter: string }[],
97 wordList: string[] = wordListCache || [],

parquetApp.tsx1 match

@maxm•Updated 18 hours ago
3import { Chat } from "./Chat.tsx";
4
5export function App() {
6 return (
7 <div className="app-container">

parquetpages.html1 match

@maxm•Updated 18 hours ago
110 const pages = __PAGES_DATA__;
111
112 function renderPages() {
113 const pagesListElement = document.getElementById('pagesList');
114

ApiifyApp.tsx1 match

@wolf•Updated 18 hours ago
31}
32
33export function App() {
34 const [url, setUrl] = useState("");
35 const [maxPages, setMaxPages] = useState(5);
tuna

tuna9 file matches

@jxnblk•Updated 17 hours 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.