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=1582&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 18616 results for "function"(3140ms)

MADBOTSmain.tsx1 match

@jonbo•Updated 11 months ago
3const DISCORD_WEBHOOK = Deno.env.get("DISCORD_TANAKI_WEBHOOK");
4
5export default async function(interval: Interval) {
6 const supabase = createClient(
7 Deno.env.get("TANAKI_SUPABASE_URL"),

MADBOTSREADME.md1 match

@jonbo•Updated 11 months ago
1# MAD BOTS (Multi-functional Alerting & Diagnostics Bot Operations Tracking System)
2
3This val runs every two minutes and makes sure a supabase realtime websocket listener is still alive.

typewritermain.tsx2 matches

@iamseeley•Updated 11 months ago
1export function typeWriter(element, text, callback = () => {}) {
2 let i = 0;
3 function type() {
4 if (i < text.length) {
5 element.textContent += text.charAt(i);

typingClimain.tsx2 matches

@iamseeley•Updated 11 months ago
1export function typingCli(element, text, callback = () => {}) {
2 let i = 0;
3 function type() {
4 if (i < text.length) {
5 const span = document.createElement('span');

createGeneratedValREADME.md1 match

@yawnxyz•Updated 11 months ago
1# Use GPT to generate vals on your account!
2
3Describe the val that you need, call this function, and you'll get a new val on your workspace generated by OpenAI's API!
4
5First, ensure you have a [Val Town API Token](https://www.val.town/settings/api), then call `@andreterron.createGeneratedVal({...})` like this [example](https://www.val.town/v/andreterron.untitled_tomatoKiwi):

hitCountermain.tsx1 match

@triptych•Updated 11 months ago
7await blob.setJSON(KEY, oldState + 1);
8const siteCount = await blob.getJSON(KEY);
9export default async function(req: Request): Promise<Response> {
10 return Response.json({ siteCount });
11}

tldrawReactExportScriptmain.tsx1 match

@tfayyaz•Updated 11 months ago
3import { Tldraw } from "https://esm.sh/tldraw@2.1.0";
4
5export function MyApp() {
6 return (
7 <div style={{ position: "fixed", inset: 0 }}>

lavenderPinnipedREADME.md1 match

@jamisonl•Updated 11 months ago
1Bot for Cama discord server. To initialize new slash commands, you have to run a separate bit of code. This is for modifying their functionality

currentTimemain.tsx2 matches

@iamseeley•Updated 11 months ago
1export function currentTime(element) {
2 function update() {
3 const now = new Date();
4 const timeString = now.toLocaleTimeString();

handleDiscordInteractionREADME.md1 match

@jamisonl•Updated 11 months ago
1Bot for Cama discord server. To initialize new slash commands, you have to run a separate bit of code. This is for modifying their functionality

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
webup
LangChain (https://langchain.com) Ambassador, KubeSphere (https://kubesphere.io) Ambassador, CNCF OpenFunction (https://openfunction.dev) TOC Member.
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": "*",