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=1427&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 18497 results for "function"(5990ms)

chronospheremain.tsx8 matches

@all•Updated 7 months ago
88};
89
90function App() {
91 const canvasRef = useRef(null);
92 const [isLoaded, setIsLoaded] = useState(false);
168 const mouse = new THREE.Vector2();
169
170 function onMouseMove(event) {
171 mouse.x = (event.clientX / window.innerWidth) * 2 - 1;
172 mouse.y = -(event.clientY / window.innerHeight) * 2 + 1;
187 window.addEventListener("mousemove", onMouseMove, false);
188
189 function animate(time) {
190 requestAnimationFrame(animate);
191
252}
253
254function client() {
255 console.log("Client function called");
256 const root = document.getElementById("root");
257 if (root) {
264
265if (typeof document !== "undefined") {
266 console.log("Document is defined, calling client function");
267 client();
268}
269
270export default async function server(request: Request): Promise<Response> {
271 console.log("Server function called");
272 return new Response(
273 `

chronoGenmain.tsx4 matches

@all•Updated 7 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 7 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 7 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 7 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 7 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 7 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 7 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 7 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 7 months ago
1export default async function server(request: Request): Promise<Response> {
2 // Check if the request method is GET
3 if (request.method === 'GET') {

getFileEmail4 file matches

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

tuna8 file matches

@jxnblk•Updated 2 weeks 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.