smallAndCuteSnakeGamemain.tsx3 matches
3import { createRoot } from "https://esm.sh/react-dom/client";
45function App() {
6const [count, setCount] = useState(0);
755}
5657function client() {
58createRoot(document.getElementById("root")).render(<App />);
59}
63}
6465export default async function server(request: Request): Promise<Response> {
66return new Response(`
67<!DOCTYPE html>
3import { createRoot } from "https://esm.sh/react-dom/client";
45function App() {
6const [items, setItems] = useState([]);
7const [newItem, setNewItem] = useState("");
75}
7677function client() {
78createRoot(document.getElementById("root")).render(<App />);
79}
83}
8485export default async function server(request: Request): Promise<Response> {
86const { sqlite } = await import("https://esm.town/v/stevekrouse/sqlite");
87const SCHEMA_VERSION = 1;
createFlashcardsValmain.tsx3 matches
9cherry,a small round stone fruit with red skin`;
1011function App() {
12const [flashcards, setFlashcards] = useState([]);
13const [currentCard, setCurrentCard] = useState(null);
95}
9697function client() {
98createRoot(document.getElementById("root")).render(<App />);
99}
103}
104105export default async function server(request: Request): Promise<Response> {
106const url = new URL(request.url);
107
browserbasePuppeteerExamplemain.tsx2 matches
2import puppeteer from "npm:puppeteer-core";
34async function sendPDF() {
5console.log("Initiating pdf sender");
6const browser = await puppeteer.connect({
28}
2930export default async function() {
31console.log("RUnning");
32await sendPDF();
generateDailyTwitterEmailmain.tsx3 matches
1import { email } from "https://esm.town/v/std/email";
23async function fetchTweets(listId: string): Promise<any[]> {
4const url = `https://news.ycombinator.com/`;
5const response = await fetch(url);
17}
1819function formatTweetsForEmail(tweets: any[]): string {
20return tweets.map((tweet, index) => `
21${index + 1}. @${tweet.username} (${tweet.likes} likes)
25}
2627export default async function(interval: Interval) {
28const listId = "1359390628841480192";
29const tweets = await fetchTweets(listId);
randomTextGeneratormain.tsx3 matches
3import { createRoot } from "https://esm.sh/react-dom/client";
45function App() {
6const [paragraphs, setParagraphs] = useState(1);
7const [text, setText] = useState("");
64}
6566function client() {
67createRoot(document.getElementById("root")).render(<App />);
68}
69if (typeof document !== "undefined") { client(); }
7071export default async function server(request: Request): Promise<Response> {
72const url = new URL(request.url);
73const paragraphs = Number(url.searchParams.get("paragraphs")) || 1;
anthropicCachingmain.tsx8 matches
1/**
2* This val creates an interactive webpage that demonstrates the functionality of the Anthropic API.
3* It uses a React frontend with an input for the API key and buttons to trigger different operations.
4* The Anthropic API key is stored in the frontend state and sent with each API request.
9import { createRoot } from "https://esm.sh/react-dom/client";
1011function App() {
12const [apiKey, setApiKey] = useState("");
13const [outputs, setOutputs] = useState({
82}
8384function client() {
85createRoot(document.getElementById("root")).render(<App />);
86}
90}
9192async function server(request: Request): Promise<Response> {
93const url = new URL(request.url);
94138}
139140async function fetchContent(): Promise<string> {
141const response = await fetch("https://www.gutenberg.org/cache/epub/1342/pg1342.txt");
142const text = await response.text();
146}
147148async function runNonCachedCall(apiKey: string): Promise<string> {
149const { default: anthropic } = await import("npm:@anthropic-ai/sdk@0.26.1");
150const client = new anthropic.Anthropic({ apiKey });
182}
183184async function runCachedCall(apiKey: string): Promise<string> {
185const { default: anthropic } = await import("npm:@anthropic-ai/sdk@0.26.1");
186const client = new anthropic.Anthropic({ apiKey });
221}
222223async function runMultiTurnConversation(apiKey: string): Promise<string> {
224const { default: anthropic } = await import("npm:@anthropic-ai/sdk@0.26.1");
225const client = new anthropic.Anthropic({ apiKey });
anthropicCachingmain.tsx8 matches
1/**
2* This val creates an interactive webpage that demonstrates the functionality of the Anthropic API.
3* It uses a React frontend with an input for the API key and buttons to trigger different operations.
4* The Anthropic API key is stored in the frontend state and sent with each API request.
9import { createRoot } from "https://esm.sh/react-dom/client";
1011function App() {
12const [apiKey, setApiKey] = useState("");
13const [outputs, setOutputs] = useState({
82}
8384function client() {
85createRoot(document.getElementById("root")).render(<App />);
86}
90}
9192async function server(request: Request): Promise<Response> {
93const url = new URL(request.url);
94138}
139140async function fetchContent(): Promise<string> {
141const response = await fetch("https://www.gutenberg.org/cache/epub/1342/pg1342.txt");
142const text = await response.text();
146}
147148async function runNonCachedCall(apiKey: string): Promise<string> {
149const { default: anthropic } = await import("npm:@anthropic-ai/sdk@0.26.1");
150const client = new anthropic.Anthropic({ apiKey });
182}
183184async function runCachedCall(apiKey: string): Promise<string> {
185const { default: anthropic } = await import("npm:@anthropic-ai/sdk@0.26.1");
186const client = new anthropic.Anthropic({ apiKey });
221}
222223async function runMultiTurnConversation(apiKey: string): Promise<string> {
224const { default: anthropic } = await import("npm:@anthropic-ai/sdk@0.26.1");
225const client = new anthropic.Anthropic({ apiKey });
1import { OpenAI } from "https://esm.town/v/std/openai";
23export default async function(req: Request): Promise<Response> {
4if (req.method === "OPTIONS") {
5return new Response(null, {