cordialGoldGerbilmain.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">
cerebrasTemplatemain.tsx3 matches
3import React, { useState } from "https://esm.sh/react@18.2.0";
45function App() {
6const [messages, setMessages] = useState([]);
7const [input, setInput] = useState("");
71}
7273function client() {
74createRoot(document.getElementById("root")).render(<App />);
75}
79}
8081export default async function server(request: Request): Promise<Response> {
82if (request.method === "POST" && new URL(request.url).pathname === "/chat") {
83const { messages } = await request.json();
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">
wordcountermain.tsx2 matches
112const twitterCount = document.getElementById('twitterCount');
113114function updateCounts() {
115const encoder = new TextEncoder();
116const utf8 = new Uint8Array(inputText.value.length * 3);
150}
151152function adjustTextareaHeight() {
153inputText.style.height = 'auto';
154inputText.style.height = inputText.scrollHeight + 10 + 'px';
karate_classesmain.tsx10 matches
26});
2728function App({ email, isAdmin }) {
29return (
30<BrowserRouter>
70}
7172function Home() {
73return (
74<div className="text-center">
79}
8081function Login() {
82return (
83<div className="max-w-md mx-auto bg-white rounded-lg shadow-md p-8">
93}
9495function ClassList({ email }) {
96const [classes, setClasses] = useState([]);
97125}
126127function ClassDetails({ email, isAdmin }) {
128const { id } = useParams();
129const [classInfo, setClassInfo] = useState(null);
240}
241242function Admin() {
243return (
244<div>
251}
252253function ClassForm() {
254const { id } = useParams();
255const [formData, setFormData] = useState({
405}
406407function BulkAddUsers() {
408const { id } = useParams();
409const [emails, setEmails] = useState("");
455}
456457function client() {
458const root = document.getElementById("root");
459if (root) {
696});
697698async function handler(request: Request): Promise<Response> {
699const { sqlite } = await import("https://esm.town/v/stevekrouse/sqlite");
700const KEY = "karate_classes";
URLReceivermainFunctionTest2 matches
1import { expect } from "jsr:@std/expect";
2import { checkWebsite } from "./mainFunctionURLReciver2";
34console.log("Starting Website Checker Tests");
12];
1314async function runTests() {
15console.log("\nTesting valid website URL");
16let result = await checkWebsite(TEST_URLS[0]);
URLReceiversummaryURLReceiverTest7 matches
47interface TestCase {
48description: string;
49function: Function;
50expectedBehavior: string;
51}
5253function logTestInfo(message: string) {
54console.log(` ${message}`);
55}
59description: "Initialize generator",
60expectedBehavior: "Should start with empty state",
61function: () => {
62console.log("\nTEST: Initialize generator");
63console.log("Expected: Should start with no URLs processed\n");
83description: "Process test URLs",
84expectedBehavior: "Should identify working and broken URLs",
85function: () => {
86console.log("\nTEST: Processing multiple URLs");
87console.log("Expected: Should correctly identify good and bad URLs\n");
124description: "Test error handling",
125expectedBehavior: "Should handle different types of errors",
126function: () => {
127console.log("\nTEST: Error handling");
128console.log("Expected: Should identify and explain different errors\n");
182];
183184async function runTests() {
185console.log("Starting test run...\n");
186let passed = 0;
189for (const test of tests) {
190try {
191await test.function();
192console.log("\nā TEST PASSED");
193passed++;
1export function getBugCSS() {
2return `
3body {
67}
6869export function getCSS() {
70return `
71body {
subtleAmaranthWaspmain.tsx5 matches
3import React, { useCallback, useEffect, useState } from "https://esm.sh/react@18.2.0";
45function NewTokenDisplay({ data }) {
6return (
7<div className="new-token">
34}
3536function SubscriptionControl({ type, isConnected, isSubscribed, onSubscribe, onUnsubscribe }) {
37return (
38<div className="subscription-control">
47}
4849function App() {
50const [messages, setMessages] = useState({
51newToken: [],
158}
159160function client() {
161createRoot(document.getElementById("root")).render(<App />);
162}
166}
167168export default async function server(req: Request): Promise<Response> {
169return new Response(
170`
URLReceiverurlCrawlerTests8 matches
17inputs: Record<string, unknown>;
18expectedBehavior: string;
19function: Function;
20}
2127inputs: {},
28expectedBehavior: "should return initial progress state",
29function: () => {
30crawler.reset();
31const progress = crawler.getProgress();
41inputs: { url: TEST_URLS[0] },
42expectedBehavior: "should not crawl beyond specified depth",
43function: async (inputs) => {
44// Create mock URLs with known depths
45const baseUrl = inputs.url;
105inputs: { url: TEST_URLS[0] },
106expectedBehavior: "should only crawl URLs from the same domain",
107function: async (inputs) => {
108const result = await crawler.crawl(inputs.url);
109133},
134expectedBehavior: "should normalize URLs consistently",
135function: async (inputs) => {
136const results = await Promise.all(
137inputs.testUrls.map(url => crawler.crawl(url)),
157},
158expectedBehavior: "should properly categorize different errors",
159function: async (inputs) => {
160const results = await Promise.all(
161inputs.testUrls.map(url => crawler.crawl(url)),
177];
178179async function runTests() {
180console.log("\nStarting enhanced test suite...");
181let passed = 0;
187188try {
189await test.function(test.inputs);
190console.log("ā Test passed\n");
191passed++;