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%22Image%20title%22?q=function&page=2429&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 26879 results for "function"(2123ms)

valTownSearchmain.tsx1 match

@pomdtr•Updated 1 year ago
5const githubQuery = (query: string) => encodeURIComponent(`${query} repo:pomdtr/val-town-mirror path:vals/`);
6
7async function handler(req: Request) {
8 const url = new URL(req.url);
9

ilyBdaymain.tsx1 match

@emilycoe•Updated 1 year ago
2import { render } from "npm:preact-render-to-string";
3
4export default async function(req: Request) {
5 return new Response(
6 render(

renderFormAndSaveDataREADME.md1 match

@sjerred•Updated 1 year ago
1# Render form and save data
2
3This val provides a web-based interface for collecting email addresses. It features a dual-functionality approach: when accessed via a web browser using a GET request, it serves an HTML form where users can submit their email address. If the script receives a POST request, it implies that the form has been submitted, and it proceeds to handle the incoming data.
4
5Fork this val to customize it and use it on your account.

weatherGPTmain.tsx1 match

@stevekrouse•Updated 1 year ago
31console.log(text);
32
33export async function weatherGPT() {
34 await email({ subject: "Weather Today", text });
35}

caloriesmain.tsx2 matches

@stevekrouse•Updated 1 year ago
5import { Hono } from "npm:hono@3";
6
7function esmTown(url) {
8 return fetch(url, {
9 headers: {
92});
93
94export async function calorieEstimate(file: File) {
95 const dataURL = await fileToDataURL(file);
96 try {

launch_thrifty_idea_generatormain.tsx1 match

@cotr•Updated 1 year ago
1export default async function(req: Request): Promise<Response> {
2 if (req.method === "OPTIONS") {
3 return new Response("ok");

staticChessREADME.md1 match

@compuives•Updated 1 year ago
6Plain, brutalist, no bloat chess. Every page is only html and css. Every chess move is made by clicking a link. Send a link to your friend and they'll send you one back to make your move. No silly animations or slick interactivity to trip up your gameplay. When Google indexes this site will we successfully compute all possible chess moves?
7
8Functionality is quite limited, and things might be broken. Please let me know if you find bugs!
9
10Inspired by [this HN discussion](https://news.ycombinator.com/item?id=39456467) about sites that have all possible game states of tic-tac-toe.

aqimain.tsx1 match

@mihai•Updated 1 year ago
2import { easyAQI } from "https://esm.town/v/stevekrouse/easyAQI";
3
4export async function aqi(interval: Interval) {
5 const location = "bucharest"; // <-- change to place, city, or zip code
6 const data = await easyAQI({ location });

dubLinksUpsertmain.tsx1 match

@evilsteventey•Updated 1 year ago
7});
8
9export default async function(req: Request): Promise<Response> {
10 const { shortLink } = await dub.links.upsert({
11 url: "https://www.val.town/v/steventey/dubLinksUpsert",

apricotSlothmain.tsx1 match

@paulkinlan•Updated 1 year ago
5const newBoard = await board(() => {
6 const { result } = core.runJavascript({
7 code: "function name() { return { name: \"Hello\" };}",
8 "name": "name",
9 });

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.