1import { capturePostHogEvent } from "https://esm.town/v/ianvph/capturePostHogEvent";
2
3export default async function(req: Request): Promise<Response> {
4 if (req.method !== "POST") {
5 return Response.json({ ok: "only post request" });
1import { capturePostHogEvent } from "https://esm.town/v/ianvph/capturePostHogEvent";
2
3export default async function(req: Request): Promise<Response> {
4 if (req.method !== "POST") {
5 return Response.json({ ok: "only post request" });
3import { createRoot } from "https://esm.sh/react-dom@18.2.0/client";
4
5function LinkInBio() {
6 // Brutalist design profile data
7 const profileData = {
135}
136
137function client() {
138 createRoot(document.getElementById("root")).render(<LinkInBio />);
139}
140if (typeof document !== "undefined") { client(); }
141
142export default async function server(request: Request): Promise<Response> {
143 return new Response(`
144 <html>
277});
278
279function Style() {
280 return (
281 <style>
294}
295
296function Logout() {
297 return (
298 <form action="/logout" method="post">
318
319/**
320 * This function can be used on its own
321 * to commit multiple files to a GitHub repo
322 */
323export async function commitFiles({
324 token,
325 owner,
3import { createRoot } from "https://esm.sh/react-dom@18.2.0/client";
4
5function App() {
6 const [words, setWords] = useState<string[]>([]);
7 const [startWord, setStartWord] = useState('');
68}
69
70function client() {
71 createRoot(document.getElementById("root")).render(<App />);
72}
73if (typeof document !== "undefined") { client(); }
74
75export default async function server(request: Request): Promise<Response> {
76 const url = new URL(request.url);
77
3import { createRoot } from "https://esm.sh/react-dom@18.2.0/client";
4
5// Utility function for password hashing
6async function hashPassword(password: string) {
7 const encoder = new TextEncoder();
8 const data = encoder.encode(password);
13}
14
15function App() {
16 const [user, setUser] = useState(null);
17 const [query, setQuery] = useState("");
292}
293
294function client() {
295 createRoot(document.getElementById("root")).render(<App />);
296}
297if (typeof document !== "undefined") { client(); }
298
299export default async function server(request: Request): Promise<Response> {
300 const { sqlite } = await import("https://esm.town/v/stevekrouse/sqlite");
301 const KEY = "YouTubeSaveApp";
3import React, { useEffect, useState } from "https://esm.sh/react@18.2.0";
4
5function App() {
6 const [user, setUser] = useState(null);
7 const [posts, setPosts] = useState([]);
133}
134
135function LoginForm({ onLogin }) {
136 const [username, setUsername] = useState("");
137 const [password, setPassword] = useState("");
161}
162
163function client() {
164 createRoot(document.getElementById("root")).render(<App />);
165}
166if (typeof document !== "undefined") { client(); }
167
168export default async function server(request: Request): Promise<Response> {
169 const { blob } = await import("https://esm.town/v/std/blob");
170 const { sqlite } = await import("https://esm.town/v/stevekrouse/sqlite");
3import React from "https://esm.sh/react@18.2.0";
4
5// Function to generate CSS with variables and styles
6function generateCSS() {
7 return `
8 :root {
108
109// Group links by section
110function groupLinksBySection(links: SavedLink[]) {
111 return links.reduce((acc, link) => {
112 if (!acc[link.section]) {
119
120// Link component with data attribute for edit URL
121function SavedLink({ link }: { link: SavedLink }) {
122 return (
123 <a
131}
132
133function client() {
134 // Prevent the default context menu globally
135 document.addEventListener('contextmenu', (e) => {
160}
161
162export default async function(req: Request) {
163 const groupedLinks = groupLinksBySection(savedLinks);
164
19let lastRequestTime = 0;
20
21function App() {
22 const [verse, setVerse] = useState<{ text: string; reference: string; version: string } | null>(null);
23 const [status, setStatus] = useState<"idle" | "loading" | "error">("loading");
246}
247
248function client() {
249 createRoot(document.getElementById("root")).render(<App />);
250}
251if (typeof document !== "undefined") { client(); }
252
253export default async function server(request: Request): Promise<Response> {
254 // Handle worker endpoint
255 if (new URL(request.url).pathname.endsWith('/worker')) {
3import { createRoot } from "https://esm.sh/react-dom@18.2.0/client";
4
5function App() {
6 const [words, setWords] = useState<string[]>([]);
7 const [startWord, setStartWord] = useState('');
63}
64
65function client() {
66 createRoot(document.getElementById("root")).render(<App />);
67}
68if (typeof document !== "undefined") { client(); }
69
70export default async function server(request: Request): Promise<Response> {
71 const url = new URL(request.url);
72
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": "*",