3import { createRoot } from "https://esm.sh/react-dom/client";
4
5function FAQ({ question, answer }) {
6 const [isOpen, setIsOpen] = useState(false);
7
30}
31
32function GallagherArticle() {
33 const faqs = [
34 {
133}
134
135function client() {
136 createRoot(document.getElementById("root")).render(<GallagherArticle />);
137}
139if (typeof document !== "undefined") { client(); }
140
141export default async function server(request: Request): Promise<Response> {
142 return new Response(`
143 <html>
134];
135
136function ExternalLinks() {
137 return (
138 <div className="external-links">
159}
160
161function BandIntroduction() {
162 return (
163 <div className="band-introduction">
188}
189
190function AlbumCard({ album }) {
191 return (
192 <div className="album-card">
206}
207
208function App() {
209 return (
210 <div className="oasis-discography">
224}
225
226function client() {
227 createRoot(document.getElementById("root")).render(<App />);
228}
229if (typeof document !== "undefined") { client(); }
230
231export default async function handler(request: Request): Promise<Response> {
232 return new Response(`
233 <html>
4import { createRoot } from "https://esm.sh/react-dom/client";
5
6function App() {
7 const [message, setMessage] = useState("");
8 const [status, setStatus] = useState("");
82}
83
84function client() {
85 createRoot(document.getElementById("root")).render(<App />);
86}
87if (typeof document !== "undefined") { client(); }
88
89export default async function server(request: Request): Promise<Response> {
90 if (request.method === "POST" && new URL(request.url).pathname === "/post-bluesky") {
91 try {
2
3// Fetches a random joke.
4function fetchRandomJoke() {
5 const response = fetch(
6 "https://official-joke-api.appspot.com/random_joke",
5import { createRoot } from "https://esm.sh/react-dom/client";
6
7function ThankYouCard({ note, theme, font, recipientName, senderName }) {
8 const [firstHalf, secondHalf] = splitNote(note);
9
30}
31
32function splitNote(note) {
33 const words = note.split(" ");
34 const midpoint = Math.ceil(words.length / 2);
39}
40
41function capitalizeName(name) {
42 if (!name) return "";
43 return name
50}
51
52function App() {
53 const [recipientName, setRecipientName] = useState("");
54 const [senderName, setSenderName] = useState("");
295}
296
297function client() {
298 createRoot(document.getElementById("root")).render(<App />);
299}
303}
304
305export default async function server(request: Request): Promise<Response> {
306 console.log(`Received ${request.method} request to ${request.url}`);
307
127];
128
129function VideoPlayer({ course }: { course: Course }) {
130 const [currentVideo, setCurrentVideo] = useState<CourseVideo | null>(null);
131 const [progress, setProgress] = useState(0);
206}
207
208function CourseCatalog() {
209 const [selectedCourse, setSelectedCourse] = useState<Course | null>(null);
210 const [filter, setFilter] = useState<string | null>(null);
290}
291
292function App() {
293 return <CourseCatalog />;
294}
295
296function client() {
297 createRoot(document.getElementById("root")).render(<App />);
298}
299if (typeof document !== "undefined") { client(); }
300
301export default async function server(request: Request): Promise<Response> {
302 return new Response(`
303 <html>
3import { createRoot } from "https://esm.sh/react-dom/client";
4
5function App() {
6 const [feedUrl, setFeedUrl] = React.useState("https://usv.com/feed/");
7 const [results, setResults] = React.useState(null);
94}
95
96function client() {
97 createRoot(document.getElementById("root")).render(<App />);
98}
102}
103
104export default async function server(request: Request): Promise<Response> {
105 const url = new URL(request.url);
106
9}
10
11export async function runGlif({
12 id,
13 inputs,
3import { createRoot } from "https://esm.sh/react-dom/client";
4
5function CryptoPriceApp() {
6 const [prices, setPrices] = useState<{
7 bitcoin: { current: number | null, previous: number | null },
15
16 useEffect(() => {
17 async function fetchCryptoPrices() {
18 try {
19 // Fetch Bitcoin price from CoinDesk
195}
196
197function client() {
198 createRoot(document.getElementById("root")).render(<CryptoPriceApp />);
199}
200if (typeof document !== "undefined") { client(); }
201
202export default async function server(request: Request): Promise<Response> {
203 return new Response(`
204 <html>
1export function brokenCountVowels(str) {
2 const lowerStr = str.toLowerCase();
3 const vowels = ["a", "e"]; // Still broken - only counting 'a' and 'e'
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": "*",