8});
9
10export default async function(req: Request) {
11 if (req.method === "POST") {
12 const formData = await req.formData();
7import About from "https://esm.town/v/vawogbemi/whoIsHiringAbout";
8
9function App() {
10 const tabs = { "/": "Home", "/about": "About" };
11 const [activeTab, setActiveTab] = useState("/");
335}
336
337function ServerApp() {
338 return (
339 <html>
358}
359
360export default async function(req: Request): Promise<Response> {
361 const url = new URL(req.url);
362 if (url.pathname === "/api/stories") {
15import { Hono } from 'npm:hono';
16
17function html() {
18 /*
19<!DOCTYPE html>
38}
39
40function css() {
41 /*
42body {
82}
83
84function js() {
85 /*
86const { jsPDF } = window.jspdf;
91convertBtn.addEventListener('click', convertToPDF);
92
93async function convertToPDF() {
94 const files = imageInput.files;
95 if (files.length === 0) {
121}
122
123function readFileAsDataURL(file) {
124 return new Promise((resolve, reject) => {
125 const reader = new FileReader();
130}
131
132function loadImage(blob) {
133 return new Promise((resolve, reject) => {
134 const src = URL.createObjectURL(blob);
2import { base58 } from "npm:@scure/base";
3
4export function convertUUIDToToken(uuid: string): string {
5 return "vt_" + base58.encode(Buffer.from(uuid.replace(/-/g, ""), "hex"));
6}
7
8export function generateAndConvertUUIDs() {
9 const uuidBuffer = Buffer.alloc(16);
10 let tokenLength = 0;
41const identifier = "bedtime-story-limiter";
42
43async function enforceRateLimit() {
44 const ratelimit = await unkey.limit(identifier);
45
52const app = new Hono();
53
54function parseStory(text) {
55 // Split the text into lines and remove empty lines
56 const lines = text.split("\n").filter(line => line.trim() !== "");
6const APP_ID = "5518c0f9-481c-4aa8-85cd-eee42bd45319";
7
8function BikeWindow({ bike, onSave, onClose, title }) {
9 const [brand, setBrand] = useState(bike?.brand || "");
10 const [model, setModel] = useState(bike?.model || "");
112}
113
114function App() {
115 const [bikes, setBikes] = useState([]);
116 const [error, setError] = useState(null);
315}
316
317function client() {
318 console.log("Client function called");
319 const root = document.getElementById("root");
320 if (root) {
327
328if (typeof document !== "undefined") {
329 console.log("Document is defined, calling client function");
330 client();
331} else {
333}
334
335async function server(request: Request): Promise<Response> {
336 console.log("Server function called");
337 return new Response(
338 `
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
1export default function(req: Request) {
2 const url = new URL(req.url);
3 const newUrl = "https://opensourcepledge.com" + url.pathname + url.search;
28};
29
30function generateName(pattern: string): string {
31 return pattern.replace(/<(\w+)>/g, (match, p1) => {
32 switch (p1) {
189const Pixel = ({ active }) => <div className={`pixel ${active ? "active" : ""}`} />;
190
191function App() {
192 const [size, setSize] = useState<{ width: number; height: number }>(DEFAULT_SIZE);
193 const [pixels, setPixels] = useState<boolean[]>(() =>
431}
432
433function client() {
434 try {
435 const root = createRoot(document.getElementById("root"));
452}
453
454async function server(request: Request): Promise<Response> {
455 return new Response(
456 `
467 <div id="root"></div>
468 <script>
469 window.onerror = function(message, source, lineno, colno, error) {
470 console.error("Global error caught:", message, "at", source, ":", lineno, ":", colno);
471 console.error("Error object:", error);
3import process from "node:process";
4
5export async function serverlessMatrixEchoBot(
6 req: express.Request,
7 res: express.Response,