6];
7
8// Function to generate HTML for the prompt selector
9function generatePromptSelector() {
10 const options = prompts.map(prompt => `<option value="${prompt}">${prompt}</option>`).join("");
11
35 </div>
36 <script>
37 function handlePromptSelection() {
38 const select = document.getElementById('promptSelect');
39 const result = document.getElementById('result');
54}
55
56// HTTP handler function
57export async function promptSelectorHandler(req) {
58 const html = generatePromptSelector();
59 return new Response(html, {
2import { renderToString } from "npm:react-dom/server";
3
4export default async function(req: Request) {
5 return new Response(
6 renderToString(
49};
50
51export default async function handler(req: Request): Promise<Response> {
52 const html = renderToString(
53 <html>
33- [x] fix wonky sidebar separator height problem (thanks to @stevekrouse)
34- [x] make result tables scrollable
35- [x] add export to CSV, and JSON (CSV and JSON helper functions written in [this val](https://www.val.town/v/nbbaier/sqliteExportHelpers). Thanks to @pomdtr for merging the initial version!)
36- [x] add listener for cmd+enter to submit query
5import axios from "npm:axios@0.21.1";
6
7export default async function main() {
8 // Fetch weather data for Brooklyn, NY
9
1export default async function(req: Request): Promise<Response> {
2 const url = new URL(req.url);
3 const domain = url.searchParams.get("domain");
8)`);
9
10function two_decimals(number: number) {
11 return round(number, 2);
12}
20});
21
22async function add_city(coordinates: Coordinates): Promise<string> {
23 const searchParams = new URLSearchParams({
24 q: [
51type Coordinates = readonly [number, number];
52
53export async function city(coordinates: Coordinates): Promise<string> {
54 const key = coordinates.map(two_decimals).join(",");
55
64}
65
66export default async function(request: Request): Promise<Response> {
67 const searchParams = new URL(request.url).searchParams;
68
4const substrate = new Substrate({ apiKey: Deno.env.get("SUBSTRATE_API_KEY") });
5
6export default async function render(req: Request): Promise<Response> {
7 const url = new URL(req.url);
8 const searchParams = url.searchParams;
2import process from "node:process";
3
4export async function notify(request: Request) {
5 if (request.method === "OPTIONS") {
6 return new Response("", {
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.
A helper function to build a file's email
Simple functional CSS library for Val Town
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": "*",
LangChain (https://langchain.com) Ambassador, KubeSphere (https://kubesphere.io) Ambassador, CNCF OpenFunction (https://openfunction.dev) TOC Member.