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%22Optional%20title%22?q=function&page=2503&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 29303 results for "function"(6405ms)

bbrunmain.tsx2 matches

@kenbarrett•Updated 8 months ago
2
3/**
4 * You can supply these options as a second argument to the `proxy` function.
5 * These options are used to configure the frontend.
6 */
135
136export const proxy = (url: string, options?: FrontendOptions) => {
137 return async function(req: Request): Promise<Response> {
138 if (req.method === "GET") {
139 return renderFrontend(url, options);

BrowserbaseFetcherFromURLmain.tsx1 match

@willthereader•Updated 8 months ago
4const TIMEOUT = 30000; // 30 seconds timeout
5
6export default async function server(request: Request): Promise<Response> {
7 // Array of URLs to scrape
8 const urls = [

entireGoldLarkmain.tsx1 match

@nlnhsr•Updated 8 months ago
128
129export const service = (boardUrl: string, options?: ServiceOptions) => {
130 return async function(req: Request): Promise<Response> {
131 const url = new URL(req.url);
132 const path = url.pathname;

openaiproxymain.tsx2 matches

@roadlabs•Updated 8 months ago
18
19type User = { id: string; username: string; tier: string };
20export default async function(req: Request): Promise<Response> {
21 // Ensure only allowed pathnames are used
22 const { pathname, search } = new URL(req.url);
82
83// Free users are limited to gpt-4o-mini. Limit pro users to 10 expensive model requests.
84async function limitFreeModel(req: Request, user: User) {
85 const input = await req.json();
86 let model = "gpt-4o-mini";

entireGoldLarkmain.tsx1 match

@odicho•Updated 8 months ago
128
129export const service = (boardUrl: string, options?: ServiceOptions) => {
130 return async function(req: Request): Promise<Response> {
131 const url = new URL(req.url);
132 const path = url.pathname;

bbrunmain.tsx2 matches

@yejun•Updated 8 months ago
2
3/**
4 * You can supply these options as a second argument to the `proxy` function.
5 * These options are used to configure the frontend.
6 */
135
136export const proxy = (url: string, options?: FrontendOptions) => {
137 return async function(req: Request): Promise<Response> {
138 if (req.method === "GET") {
139 return renderFrontend(url, options);

bbrunREADME.md1 match

@yejun•Updated 8 months ago
13must contain your board server API key.
14
15To use, create an HTTP val, then import the `proxy` function from this script and call it like this:
16
17```ts

bbrunREADME.md1 match

@kenbarrett•Updated 8 months ago
13must contain your board server API key.
14
15To use, create an HTTP val, then import the `proxy` function from this script and call it like this:
16
17```ts

Splinemain.tsx3 matches

@mrsnor•Updated 8 months ago
3import { createRoot } from "https://esm.sh/react-dom/client";
4
5function App() {
6 const [SplineComponent, setSplineComponent] = useState(null);
7 const [error, setError] = useState(null);
50}
51
52function client() {
53 createRoot(document.getElementById("root")).render(<App />);
54}
56if (typeof document !== "undefined") { client(); }
57
58async function server(request: Request): Promise<Response> {
59 return new Response(
60 `

cooingTomatoSquirrelmain.tsx4 matches

@mrsnor•Updated 8 months ago
1/** @jsxImportSource npm:hono/jsx */
2async function createSession(email: string, hostname: string) {
3 const { zip } = await import("https://esm.town/v/pomdtr/sql");
4 const { sqlite } = await import("https://esm.town/v/std/sqlite");
23}
24
25async function getSession(sessionID: string, hostname: string) {
26 const { zip } = await import("https://esm.town/v/pomdtr/sql");
27 const { sqlite } = await import("https://esm.town/v/std/sqlite");
52}
53
54async function deleteSession(sessionID: string) {
55 const { sqlite } = await import("https://esm.town/v/std/sqlite");
56
64const OAUTH_COOKIE = "oauth_store";
65
66export function lastlogin(
67 handler: (req: Request) => Response | Promise<Response>,
68) {
tuna

tuna9 file matches

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