StripeDemomain.tsx4 matches
4import { createRoot } from "https://esm.sh/react-dom/client";
56function App() {
7const [tipAmount, setTipAmount] = useState(5);
8const paymentLinks = {
63}
6465function Success() {
66useEffect(() => {
67confetti({
81}
8283function client() {
84const root = document.getElementById("root");
85if (root) {
94if (typeof document !== "undefined") { client(); }
9596export default async function server(request: Request): Promise<Response> {
97const url = new URL(request.url);
98
cerebras_codermain.tsx11 matches
24);
2526function Hero({
27prompt,
28setPrompt,
4546<p className="text-[#bababa] text-center max-w-[25ch] mx-auto my-4 font-dm-sans">
47Turn your ideas into fully functional apps in{" "}
48<span className="relative w-fit text-fuchsia-400 z-10 italic font-semibold rounded-full">
49less than a second
116}
117118function App() {
119const previewRef = React.useRef<HTMLDivElement>(null);
120const [prompt, setPrompt] = useState("");
170});
171172function handleStarterPromptClick(promptItem: typeof prompts[number]) {
173setLoading(true);
174setTimeout(() => handleSubmit(promptItem.prompt), 0);
175}
176177async function handleSubmit(e: React.FormEvent | string) {
178if (typeof e !== "string") {
179e.preventDefault();
226}
227228function handleVersionChange(direction: "back" | "forward") {
229const { currentVersionIndex, versions } = versionHistory;
230if (direction === "back" && currentVersionIndex > 0) {
974);
975976function client() {
977const path = window.location.pathname;
978const root = createRoot(document.getElementById("root")!);
1010}
10111012function extractCodeFromFence(text: string): string {
1013const htmlMatch = text.match(/```html\n([\s\S]*?)\n```/);
1014return htmlMatch ? htmlMatch[1].trim() : text;
1015}
10161017async function generateCode(prompt: string, currentCode: string) {
1018const starterPrompt = STARTER_PROMPTS.find(p => p.prompt === prompt);
1019if (starterPrompt) {
1060}
10611062export default async function cerebras_coder(req: Request): Promise<Response> {
1063// Dynamic import for SQLite to avoid client-side import
1064const { sqlite } = await import("https://esm.town/v/stevekrouse/sqlite");
1163<meta property="og:site_name" content="Cerebras Coder">
1164<meta property="og:url" content="https://cerebrascoder.com"/>
1165<meta property="og:description" content="Turn your ideas into fully functional apps in less than a second – powered by Llama3.3-70b on Cerebras's super-fast wafer chips. Code is 100% open-source, hosted on Val Town."">
1166<meta property="og:type" content="website">
1167<meta property="og:image" content="https://stevekrouse-blob_admin.web.val.run/api/public/CerebrasCoderOG.jpg">
scientificCalculatorAppmain.tsx4 matches
3import { createRoot } from "https://esm.sh/react-dom@18.2.0/client";
45function ScientificCalculator() {
6const [display, setDisplay] = useState("0");
7const [memory, setMemory] = useState(null);
89}
9091function App() {
92return (
93<div className="app-container">
105}
106107function client() {
108createRoot(document.getElementById("root")).render(<App />);
109}
110if (typeof document !== "undefined") { client(); }
111112export default async function server(request: Request): Promise<Response> {
113return new Response(`
114<html>
twitterSearchmain.tsx1 match
3import { twitterUser } from "https://esm.town/v/stevekrouse/twitterUser";
45export async function twitterSearch({
6query,
7start_time,
templateTwitterAlertmain.tsx1 match
12const isProd = false;
1314export async function twitterAlert({ lastRunAt }: Interval) {
15// If isProd, search for tweets since that last time this interval ran
16// if not, search for tweets since 48 hours ago for testing
cerebras_codermain.tsx11 matches
24);
2526function Hero({
27prompt,
28setPrompt,
4546<p className="text-[#bababa] text-center max-w-[25ch] mx-auto my-4 font-dm-sans">
47Turn your ideas into fully functional apps in{" "}
48<span className="relative w-fit text-fuchsia-400 z-10 italic font-semibold rounded-full">
49less than a second
116}
117118function App() {
119const previewRef = React.useRef<HTMLDivElement>(null);
120const [prompt, setPrompt] = useState("");
170});
171172function handleStarterPromptClick(promptItem: typeof prompts[number]) {
173setLoading(true);
174setTimeout(() => handleSubmit(promptItem.prompt), 0);
175}
176177async function handleSubmit(e: React.FormEvent | string) {
178if (typeof e !== "string") {
179e.preventDefault();
226}
227228function handleVersionChange(direction: "back" | "forward") {
229const { currentVersionIndex, versions } = versionHistory;
230if (direction === "back" && currentVersionIndex > 0) {
974);
975976function client() {
977const path = window.location.pathname;
978const root = createRoot(document.getElementById("root")!);
1010}
10111012function extractCodeFromFence(text: string): string {
1013const htmlMatch = text.match(/```html\n([\s\S]*?)\n```/);
1014return htmlMatch ? htmlMatch[1].trim() : text;
1015}
10161017async function generateCode(prompt: string, currentCode: string) {
1018const starterPrompt = STARTER_PROMPTS.find(p => p.prompt === prompt);
1019if (starterPrompt) {
1060}
10611062export default async function cerebras_coder(req: Request): Promise<Response> {
1063// Dynamic import for SQLite to avoid client-side import
1064const { sqlite } = await import("https://esm.town/v/stevekrouse/sqlite");
1163<meta property="og:site_name" content="Cerebras Coder">
1164<meta property="og:url" content="https://cerebrascoder.com"/>
1165<meta property="og:description" content="Turn your ideas into fully functional apps in less than a second – powered by Llama3.3-70b on Cerebras's super-fast wafer chips. Code is 100% open-source, hosted on Val Town."">
1166<meta property="og:type" content="website">
1167<meta property="og:image" content="https://stevekrouse-blob_admin.web.val.run/api/public/CerebrasCoderOG.jpg">
3import React, { useEffect, useState } from "https://esm.sh/react@18.2.0";
45function App() {
6const [selectedCategory, setSelectedCategory] = useState("cafe");
7const [playerName, setPlayerName] = useState("");
390};
391392function client() {
393createRoot(document.getElementById("root")).render(<App />);
394}
395if (typeof document !== "undefined") { client(); }
396397export default async function server(request: Request): Promise<Response> {
398const { sqlite } = await import("https://esm.town/v/stevekrouse/sqlite");
399const KEY = "cafetiraCafeAndBilliardTournament";
terrificBlueWhippetmain.tsx1 match
120const fireworksContainer = document.querySelector('.fireworks');
121122function createFirework() {
123const firework = document.createElement('div');
124firework.className = 'firework';
ardentVioletSwordfishmain.tsx4 matches
28};
2930function SnakeGame() {
31const [difficulty, setDifficulty] = useState('normal');
32const [level, setLevel] = useState(1);
4243// Generate random food position
44function generateFoodPosition() {
45return {
46x: Math.floor(Math.random() * boardSize),
262}
263264function client() {
265createRoot(document.getElementById("root")).render(<SnakeGame />);
266}
268if (typeof document !== "undefined") { client(); }
269270export default async function server(request: Request): Promise<Response> {
271return new Response(`
272<html>
passkeys_demomain.tsx3 matches
23console.log("hi");
24// UTILS
25function generateJWT(userId: string) {
26return new SignJWT({ userId }).setProtectedHeader({ alg: "HS256" }).sign(SECRET);
27}
28function verifyJWT(token: string) {
29return jwtVerify(token, SECRET);
30}
31function generateRandomString() {
32return Math.random().toString(36).substring(2, 15) + Math.random().toString(36).substring(2, 15);
33}