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/$2?q=function&page=2435&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 28772 results for "function"(1882ms)

dm_callback_exampleREADME.md1 match

@karanganesan•Updated 7 months ago
1Docs: https://docs.lumalabs.ai/docs/api#how-to-get-a-callback-when-generation-has-an-update
2
3you can now pass callback_url in the body of api / create function on python/js sdks.
4available on version 1.1.0
5

mlbScoreFetchermain.tsx3 matches

@charmaine•Updated 7 months ago
3import { createRoot } from "https://esm.sh/react-dom/client";
4
5function App() {
6 const [scores, setScores] = useState([]);
7 const [loading, setLoading] = useState(true);
55}
56
57function client() {
58 createRoot(document.getElementById("root")).render(<App />);
59}
63}
64
65export default async function server(request: Request): Promise<Response> {
66 const url = new URL(request.url);
67

oliveGardenCharmain.tsx4 matches

@charmaine•Updated 7 months ago
3import { createRoot } from "https://esm.sh/react-dom/client";
4
5function App() {
6 const [coworkers, setCoworkers] = useState([]);
7 const [newCoworker, setNewCoworker] = useState("");
107}
108
109function SwipeToDelete({ children, onDelete }) {
110 const [startX, setStartX] = useState(null);
111 const [offset, setOffset] = useState(0);
151}
152
153function client() {
154 createRoot(document.getElementById("root")).render(<App />);
155}
156if (typeof document !== "undefined") { client(); }
157
158export default async function server(request: Request): Promise<Response> {
159 const { sqlite } = await import("https://esm.town/v/stevekrouse/sqlite");
160 const SCHEMA_VERSION = 2;

healthtech4africamain.tsx3 matches

@thomaskangah•Updated 7 months ago
5const countries = ["Kenya", "India"];
6
7function App() {
8 const [country, setCountry] = useState("");
9 const [userId, setUserId] = useState("");
150}
151
152function client() {
153 createRoot(document.getElementById("root")).render(<App />);
154}
158}
159
160export default async function server(request: Request): Promise<Response> {
161 const { OpenAI } = await import("https://esm.town/v/std/openai");
162 const { sqlite } = await import("https://esm.town/v/stevekrouse/sqlite");

tldrawclientmain.tsx1 match

@robcobb•Updated 7 months ago
6import { Tldraw } from "https://esm.sh/tldraw@2.1.0";
7
8export function App() {
9 return (
10 <>

hello_worldmain.tsx1 match

@stevekrouse•Updated 7 months ago
1export default async function(req: Request): Promise<Response> {
2 return Response.json("hello world!");
3}

vtu_readUsermain.tsx1 match

@rozek•Updated 7 months ago
6import { blob } from "https://esm.town/v/std/blob"
7
8export default async function readUser (UserId:string):Promise<any> {
9 expectEMailAddress('user id',UserId)
10

vtu_deleteUsermain.tsx1 match

@rozek•Updated 7 months ago
5import { blob } from "https://esm.town/v/std/blob"
6
7export default async function deleteUser (UserId:string):Promise<void> {
8 expectEMailAddress('user id',UserId)
9

vtu_updateUsermain.tsx1 match

@rozek•Updated 7 months ago
7import PBKDF2Hash from 'https://esm.town/v/rozek/vtu_PBKDF2Hash'
8
9export default async function updateUser (
10 UserId:string, Password?:string, Roles?:string
11):Promise<void> {

vtu_createUsermain.tsx1 match

@rozek•Updated 7 months ago
7import PBKDF2Hash from 'https://esm.town/v/rozek/vtu_PBKDF2Hash'
8
9export default async function createUser (
10 UserId:string, Password:string, Roles:string = 'user'
11):Promise<void> {

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.