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/$%7Bsuccess?q=function&page=18&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 18182 results for "function"(1165ms)

eink-frame-remixnews.tsx2 matches

@charmaine•Updated 1 day 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 1 day 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 1 day 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";

eink-frame-remixhemolog.tsx2 matches

@charmaine•Updated 1 day ago
6
7// NOTE: Hemolog.com is a medication logging app for poeople with Hemophilia, like me 👋.
8function Render({ data }: { data: HEMOLOG_TREATMENT[] }) {
9 return (
10 <html>
41}
42
43export default async function(req: Request): Promise<Response> {
44 const data: HEMOLOG_TREATMENT[] = await GetLogs(req).then((res: any) => res.json());
45 const html = renderToString(<Render data={data} />);

eink-frame-remixhemolog.ts1 match

@charmaine•Updated 1 day ago
16};
17
18export default async function(req: Request): Promise<Response> {
19 const url = new URL(req.url);
20
3
4// TODO: Add caching of image
5export default async function generateImageFromHtml(
6 valUrl: string,
7 width: number = 800,

eink-frame-remixfontsTest.tsx2 matches

@charmaine•Updated 1 day ago
4import { BodyWrapper, Content, Footer, Header, Headline } from "../components.tsx";
5
6function Render() {
7 const line = "To be taught if fortunate";
8 return (
36}
37
38export default async function(): Promise<Response> {
39 const html = renderToString(<Render />);
40

eink-frame-remixfetchWithCache.ts1 match

@charmaine•Updated 1 day ago
6};
7
8export default async function fetchWithCache(
9 apiUrl: string,
10 cacheKey: string,

eink-frame-remixcomponents.tsx7 matches

@charmaine•Updated 1 day ago
4
5// Display components can be used to change the look and feel of each frame.
6export function Header({ title = "Eink" }) {
7 return (
8 <head>
39}
40
41export function Footer() {
42 const currentDate = new Date().toLocaleDateString("en-US", {
43 timeZone: "America/Los_Angeles",
62}
63
64export function Headline({ text = "Headline missing" }: { text: string }) {
65 return (
66 <div className="flex justify-between items-center p-5">
70}
71
72export function Content(props: any) {
73 return <div className="relative p-5 overflow-none">{props.children}</div>;
74}
75
76export function BodyWrapper(props: any) {
77 return (
78 <body className="bg-black p-0 m-0">
84}
85
86export function App() {
87 return (
88 <html>
99}
100
101export default async function(): Promise<Response> {
102 const html = renderToString(<App />);
103

eink-frame-remixapod.tsx2 matches

@charmaine•Updated 1 day ago
6
7// Displays NASA's astronomy photo of the day
8function Render({ data }: { data: APOD }) {
9 return (
10 <html>
25}
26
27export default async function(req: Request): Promise<Response> {
28 const data: APOD = await GetAPOD(req).then((res: any) => res.json());
29 const html = renderToString(<Render data={data} />);

getFileEmail4 file matches

@shouser•Updated 1 week 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": "*",