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/$1?q=function&page=2434&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 28553 results for "function"(2095ms)

chronoGenmain.tsx4 matches

@all•Updated 8 months ago
37};
38
39function App() {
40 const canvasRef = useRef(null);
41 const [renderer, setRenderer] = useState(null);
214 setOutput(''); // Clear previous output
215 try {
216 const safeEval = new Function('chs', 'data', 'setData', 'addChunkToScene', 'addModelToScene', `
217 ${code}
218 return { data, output: console.log };
321}
322
323function client() {
324 createRoot(document.getElementById("root")).render(<App />);
325}
327if (typeof document !== "undefined") { client(); }
328
329export default async function server(request: Request): Promise<Response> {
330 return new Response(`
331 <html>

getModelBuildermain.tsx2 matches

@lt_07•Updated 8 months ago
1import process from "node:process";
2
3export async function getModelBuilder(spec: {
4 type?: "llm" | "chat" | "embedding";
5 provider?: "openai" | "huggingface";
65 ],
66 ]);
67 // Return function to prevent "Serialization Error"
68 return () => setup(spec);
69}

getModelBuilder_deleted_1727331494main.tsx2 matches

@lt_07•Updated 8 months ago
1import process from "node:process";
2
3export async function getModelBuilder(spec: {
4 type?: "llm" | "chat" | "embedding";
5 provider?: "openai" | "huggingface";
65 ],
66 ]);
67 // Return function to prevent "Serialization Error"
68 return () => setup(spec);
69}

lastloginREADME.md1 match

@mrsnor•Updated 8 months ago
48```
49
50You can allow anyone to signup by returning a boolean from the verifyEmail function:
51
52```ts

lastloginmain.tsx4 matches

@mrsnor•Updated 8 months ago
4import { deleteCookie, getCookies, setCookie } from "jsr:@std/http/cookie";
5
6async function createSession(email: string, hostname: string) {
7 const sessionID = crypto.randomUUID();
8 const expiresAt = new Date();
24}
25
26async function getSession(sessionID: string, hostname: string) {
27 try {
28 const res = await sqlite.execute({
50}
51
52async function deleteSession(sessionID: string) {
53 await sqlite.execute({
54 sql: `DELETE FROM lastlogin_session WHERE sessionID=?`,
65};
66
67export function lastlogin(
68 handler: (req: Request) => Response | Promise<Response>,
69 options: LastLoginOptions,

OptimalSlogansmain.tsx1 match

@gabefletch•Updated 8 months ago
23];
24
25export default async function server(request: Request): Promise<Response> {
26 // Enable CORS for Framer
27 const headers = new Headers({

excaliEmbedmain.tsx3 matches

@all•Updated 8 months ago
3import { createRoot } from "https://esm.sh/react-dom/client";
4
5function App() {
6 return (
7 <div className="container">
25}
26
27function client() {
28 createRoot(document.getElementById("root")).render(<App />);
29}
33}
34
35export default async function server(request: Request): Promise<Response> {
36 return new Response(
37 `

addNumbersAPImain.tsx1 match

@rororowyourboat•Updated 8 months ago
1export default async function server(request: Request): Promise<Response> {
2 const url = new URL(request.url);
3 const a = Number(url.searchParams.get('a'));

returnFortyTwomain.tsx1 match

@rororowyourboat•Updated 8 months ago
1export default async function server(request: Request): Promise<Response> {
2 // Check if the request method is GET
3 if (request.method === 'GET') {

weirdOneUptimemain.tsx3 matches

@zicklag•Updated 8 months ago
5import { renderToString } from "npm:react-dom/server";
6
7function StatusRow({ rows }) {
8 return (
9 <div className="w-full flex flex-col space-y-2">
28}
29
30function StatusSection({ url, rows }) {
31 const sectionRows = rows.filter(row => row[0] === url);
32 const percentUp = Math.round((sectionRows.filter(row => row[1]).length / sectionRows.length) * 100);
44}
45
46export default async function(req: Request): Promise<Response> {
47 const { rows } = await sqlite.execute(
48 "select url, ok, duration, timestamp from uptime order by timestamp desc limit 200",

getFileEmail4 file matches

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

tuna8 file matches

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