12 * @param {number} [opts.timeout=10 minutes] - The maximum amount of time (in milliseconds) the client will wait for a response before timing out.
13 * @param {number} [opts.httpAgent] - An HTTP agent used to manage HTTP(s) connections.
14 * @param {Core.Fetch} [opts.fetch] - Specify a custom `fetch` function implementation.
15 * @param {number} [opts.maxRetries=2] - The maximum number of times the client will retry a request.
16 * @param {Core.Headers} opts.defaultHeaders - Default headers to include with every request to the API.
9Plain, 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?
10
11Functionality is quite limited, and things might be broken. Please let me know if you find bugs!
12
13Inspired by [this HN discussion](https://news.ycombinator.com/item?id=39456467) about sites that have all possible game states of tic-tac-toe.
9const app = new Hono();
10
11async function bookmarkletUrl(author: string, name: string) {
12 const resp = await fetch(`https://esm.town/v/${author}/${name}`);
13 const { code } = await minify(await resp.text());
2import { renderToString } from "npm:react-dom/server";
3
4export default async function(req: Request) {
5 return new Response(
6 renderToString(
5import react_http from "https://esm.town/v/stevekrouse/react_http?v=6";
6
7export default function(req: Request) {
8 const url = new URL(req.url);
9 if (req.method === "GET" && url.pathname === "/") {
22}
23
24export function App() {
25 const browserTZ = Intl.DateTimeFormat().resolvedOptions().timeZone;
26 const [loading, setLoading] = useState(false);
27 const [cron, setCron] = useState("0 16 * * 1-5");
28 const onSubmit: React.FormEventHandler<HTMLFormElement> = async function(e) {
29 e.preventDefault();
30 setLoading(true);
84);
85
86function Cron({ cron, timezone }) {
87 let translation;
88 try {
107}
108
109async function compile(req: Request) {
110 const form = await req.formData();
111 const description = form.get("description") as string;
1export default function({ component, sourceURL, head }: { component: Function; sourceURL: string; head?: string }) {
2 return new Response(
3 `<html>
78});
79
80function clientScript() {
81 // Set the timezone input
82 const tz = Intl.DateTimeFormat().resolvedOptions().timeZone;
96}
97
98function Cron({ cron, timezone }) {
99 let translation;
100 try {
291
292
293 // Helper function to get the supported MIME type
294 function getSupportedMimeType() {
295 const isIOS = /iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream;
296 const mimeTypes = [
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON";
2
3export async function getWeather(location: string): Promise<WeatherResponse> {
4 return fetchJSON(`https://wttr.in/${location}?format=j1`);
5}
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON";
2
3export async function getWeather(city: string): Promise<WeatherResponse> {
4 return fetchJSON(`https://wttr.in/${city}?format=j1`);
5}
A helper function to build a file's email
Simple functional CSS library for Val Town
LangChain (https://langchain.com) Ambassador, KubeSphere (https://kubesphere.io) Ambassador, CNCF OpenFunction (https://openfunction.dev) TOC Member.
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": "*",