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/$%7Burl%7D?q=function&page=2670&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 29111 results for "function"(1893ms)

upload_urlmain.tsx2 matches

@stevekrouse•Updated 1 year ago
1// Function to upload data using Wormhole API and return the URL
2async function uploadToFileIo(file) {
3 const formData = new FormData();
4 formData.append("file", file);

uploadTo0x0main.tsx1 match

@stevekrouse•Updated 1 year ago
1export async function uploadTo0x0(data, name) {
2 const blob = new Blob([data]);
3 const formData = new FormData();

dailyDadJokemain.tsx1 match

@bomberstudios•Updated 1 year ago
2import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON";
3
4export async function dailyDadJoke() {
5 let { setup, punchline } = await fetchJSON("https://official-joke-api.appspot.com/random_joke");
6 return email({

hnResumemain.tsx1 match

@cocodrilette•Updated 1 year ago
1import { email } from "https://esm.town/v/std/email?v=9";
2
3export default async function(interval: Interval) {
4 const ntfyURL = `https://ntfy.sh/${Deno.env.get("NTFY_ID")}`;
5 const hnTopStoriesURL = "https://hacker-news.firebaseio.com/v0/topstories.json";

blob_editormain.tsx4 matches

@pomdtr•Updated 1 year ago
3import { useEffect, useRef } from "https://esm.sh/hono/jsx/dom";
4
5export function BlobEditor(props: { blob: { language?: string; text: string } }) {
6 const ref = useRef();
7 const saveBlob = async () => {
43}
44
45export function blobEditor(key: string, options?: { title?: string }) {
46 return async (req: Request) => {
47 const { html } = await import("https://esm.town/v/pomdtr/gfm");
53 const { extractValInfo } = await import("https://esm.town/v/pomdtr/extractValInfo");
54
55 async function readBlob(key: string) {
56 const resp = await blob.get(key);
57 if (resp.status == 200) {
162}
163
164export default async function(req: Request) {
165 const { modifyFetchHandler } = await import("https://esm.town/v/andreterron/codeOnValTown?v=50");
166 return modifyFetchHandler(blobEditor("blob_editor_demo.md"))(req);

dailyDadJokemain.tsx1 match

@sieteunoseis•Updated 1 year ago
2import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON";
3
4export async function dailyDadJoke() {
5 let { setup, punchline } = await fetchJSON("https://official-joke-api.appspot.com/random_joke");
6 return punchline;

blobDirListmain.tsx1 match

@neverstew•Updated 1 year ago
5export const inDir = (directory: string) => (blobMeta: BlobMetadata) => blobMeta => dirname(blobMeta.key) === directory;
6
7export async function blobDirList(directory: string) {
8 const list = await blob.list(directory);
9 return list.filter(inDir(directory));

basic_authmain.tsx2 matches

@dandivelbiss•Updated 1 year ago
9};
10
11export function authMiddleware(
12 handler: (Request) => Promise<Response>,
13 options: Options,
56}
57
58export default async function(req: Request): Promise<Response> {
59 return new Response("This is middleware only");
60}

water_plant_botmain.tsx1 match

@stevekrouse•Updated 1 year ago
1import { discordWebhook } from "https://esm.town/v/stevekrouse/discordWebhook";
2
3export default async function() {
4 discordWebhook({
5 url: Deno.env.get("engDiscord"), // TODO replace this with the #office channel

dream_interpretermain.tsx1 match

@mattq•Updated 1 year ago
1export default async function(interval) {
2 // Sample phrases and words that are likely to appear in dream descriptions
3 const introPhrases = [
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.