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=101&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 19016 results for "function"(2374ms)

image-inpaintinghtml.tsx1 match

@themichaellai•Updated 6 days ago
4// import { h } from "preact";
5
6export function HTML() {
7 return (
8 <html>

pondiverseaddCreation1 match

@argmn•Updated 6 days ago
4import { TABLE_NAME } from "./updateTable";
5
6export default async function(req: Request): Promise<Response> {
7 // body contains:
8 // - title (string)

pondiverseupdateTable1 match

@argmn•Updated 6 days ago
2
3export const TABLE_NAME = "pondiverse_creations_v5";
4export default async function(req: Request): Promise<Response> {
5 await sqlite.execute(
6 `CREATE TABLE IF NOT EXISTS ${TABLE_NAME} (

untitled-7166main.tsx1 match

@welfare•Updated 6 days ago
1// main.tsx
2
3export default async function(req: Request): Promise<Response> {
4 const url = new URL(req.url);
5

eink-frame-remixREADME.md1 match

@charmaine•Updated 6 days ago
5#### Python code for display available at https://github.com/michaelwschultz/eink-frame
6
7## Functioning Hardware
8
9| News | NASA Photo of the Day |

eink-frame-remixweather.tsx3 matches

@charmaine•Updated 6 days ago
5import { BodyWrapper, Content, Footer, Header, Headline } from "../components.tsx";
6
7function getWeatherCondition(code: number): string {
8 const conditions: { [key: number]: string } = {
9 0: "Clear sky",
27}
28
29function Render({ weather }: { weather: WEATHER_FORECAST }) {
30 return (
31 <html>
54}
55
56export default async function(req: Request): Promise<Response> {
57 // You can find your coordinates here: https://www.latlong.net/
58 const latitude = 37.5296;

eink-frame-remixweather.ts1 match

@charmaine•Updated 6 days ago
27};
28
29export default async function(
30 req: Request,
31 latitude: number = 37.5296,

eink-frame-remixnews.tsx2 matches

@charmaine•Updated 6 days ago
6
7// REQUIRES API KEY - see api/news.ts
8function Render({ news }: { news: Record<string, any> }) {
9 const line = "To be taught if fortunate";
10
33}
34
35export default async function(req: Request): Promise<Response> {
36 const data = await GetNews(req).then((res: any) => res.json());
37

eink-frame-remixnews.ts1 match

@charmaine•Updated 6 days ago
3const GUARDIAN_API_KEY = Deno.env.get("GUARDIAN_API_KEY");
4
5export default async function(req: Request): Promise<Response> {
6 const url = new URL(req.url);
7 const pageSize = url.searchParams.get("pagesize");

eink-frame-remixindex.tsx1 match

@charmaine•Updated 6 days ago
6import generateImageFromHtml from "./generateImageFromHtml.ts";
7
8export default async function(req: Request) {
9 const url = new URL(req.url);
10 const isImageRequest = url.searchParams.get("generate") === "image";

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": "*",