cerebras_codermain.tsx11 matches
75const PoweredByInfo = "";
7677function Hero({
78prompt,
79setPrompt,
9697<p className="text-[#bababa] text-center max-w-[25ch] mx-auto my-4 font-dm-sans">
98Turn your ideas into fully functional apps in{" "}
99<span className="relative w-fit text-fuchsia-400 z-10 italic font-semibold rounded-full">
100less than a second
170}
171172function App() {
173const previewRef = React.useRef<HTMLDivElement>(null);
174const [prompt, setPrompt] = useState("");
224});
225226function handleStarterPromptClick(promptItem: typeof prompts[number]) {
227setLoading(true);
228setTimeout(() => handleSubmit(promptItem.prompt), 0);
229}
230231async function handleSubmit(e: React.FormEvent | string) {
232if (typeof e !== "string") {
233e.preventDefault();
280}
281282function handleVersionChange(direction: "back" | "forward") {
283const { currentVersionIndex, versions } = versionHistory;
284if (direction === "back" && currentVersionIndex > 0) {
996);
997998function client() {
999const path = window.location.pathname;
1000const root = createRoot(document.getElementById("root")!);
1032}
10331034function extractCodeFromFence(text: string): string {
1035const htmlMatch = text.match(/```html\n([\s\S]*?)\n```/);
1036return htmlMatch ? htmlMatch[1].trim() : text;
1037}
10381039async function generateCode(prompt: string, currentCode: string) {
1040const starterPrompt = STARTER_PROMPTS.find(p => p.prompt === prompt);
1041if (starterPrompt) {
1082}
10831084export default async function cerebras_coder(req: Request): Promise<Response> {
1085// Dynamic import for SQLite to avoid client-side import
1086const { sqlite } = await import("https://esm.town/v/stevekrouse/sqlite");
1185<meta property="og:site_name" content="Cerebras Coder">
1186<meta property="og:url" content="https://cerebrascoder.com"/>
1187<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."">
1188<meta property="og:type" content="website">
1189<meta property="og:image" content="https://stevekrouse-blob_admin.web.val.run/api/public/CerebrasCoderOG.jpg">
cerebrasTemplatemain.tsx2 matches
242};
243244function client() {
245createRoot(document.getElementById("root")).render(<SubscriptionTracker />);
246}
248if (typeof document !== "undefined") { client(); }
249250export default async function server(request: Request): Promise<Response> {
251const { sqlite } = await import("https://esm.town/v/stevekrouse/sqlite");
252const KEY = "cerebrasTemplate";
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();
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();
hopefulGoldChinchillamain.tsx11 matches
73const PoweredByInfo = "";
7475function Hero({
76prompt,
77setPrompt,
9495<p className="text-[#bababa] text-center max-w-[25ch] mx-auto my-4 font-dm-sans">
96Turn your ideas into fully functional apps in{" "}
97<span className="relative w-fit text-fuchsia-400 z-10 italic font-semibold rounded-full">
98less than a second
168}
169170function App() {
171const previewRef = React.useRef<HTMLDivElement>(null);
172const [prompt, setPrompt] = useState("");
222});
223224function handleStarterPromptClick(promptItem: typeof prompts[number]) {
225setLoading(true);
226setTimeout(() => handleSubmit(promptItem.prompt), 0);
227}
228229async function handleSubmit(e: React.FormEvent | string) {
230if (typeof e !== "string") {
231e.preventDefault();
278}
279280function handleVersionChange(direction: "back" | "forward") {
281const { currentVersionIndex, versions } = versionHistory;
282if (direction === "back" && currentVersionIndex > 0) {
994);
995996function client() {
997const path = window.location.pathname;
998const root = createRoot(document.getElementById("root")!);
1030}
10311032function extractCodeFromFence(text: string): string {
1033const htmlMatch = text.match(/```html\n([\s\S]*?)\n```/);
1034return htmlMatch ? htmlMatch[1].trim() : text;
1035}
10361037async function generateCode(prompt: string, currentCode: string) {
1038const starterPrompt = STARTER_PROMPTS.find(p => p.prompt === prompt);
1039if (starterPrompt) {
1080}
10811082export default async function cerebras_coder(req: Request): Promise<Response> {
1083// Dynamic import for SQLite to avoid client-side import
1084const { sqlite } = await import("https://esm.town/v/stevekrouse/sqlite");
1183<meta property="og:site_name" content="Cerebras Coder">
1184<meta property="og:url" content="https://cerebrascoder.com"/>
1185<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."">
1186<meta property="og:type" content="website">
1187<meta property="og:image" content="https://stevekrouse-blob_admin.web.val.run/api/public/CerebrasCoderOG.jpg">
2import { easyAQI } from "https://esm.town/v/stevekrouse/easyAQI?v=5";
34export async function aqi(interval: Interval) {
5const location = "411038"; // <-- change to place, city, or zip code
6const data = await easyAQI({ location });
cerebras_codermain.tsx11 matches
26const PoweredByInfo = "";
2728function Hero({
29prompt,
30setPrompt,
4748<p className="text-[#bababa] text-center max-w-[25ch] mx-auto my-4 font-dm-sans">
49Turn your ideas into fully functional apps in{" "}
50<span className="relative w-fit text-fuchsia-400 z-10 italic font-semibold rounded-full">
51less than a second!
121}
122123function App() {
124const previewRef = React.useRef<HTMLDivElement>(null);
125const [prompt, setPrompt] = useState("");
175});
176177function handleStarterPromptClick(promptItem: typeof prompts[number]) {
178setLoading(true);
179setTimeout(() => handleSubmit(promptItem.prompt), 0);
180}
181182async function handleSubmit(e: React.FormEvent | string) {
183if (typeof e !== "string") {
184e.preventDefault();
231}
232233function handleVersionChange(direction: "back" | "forward") {
234const { currentVersionIndex, versions } = versionHistory;
235if (direction === "back" && currentVersionIndex > 0) {
920);
921922function client() {
923const path = window.location.pathname;
924const root = createRoot(document.getElementById("root")!);
956}
957958function extractCodeFromFence(text: string): string {
959const htmlMatch = text.match(/```html\n([\s\S]*?)\n```/);
960return htmlMatch ? htmlMatch[1].trim() : text;
961}
962963async function generateCode(prompt: string, currentCode: string) {
964const starterPrompt = STARTER_PROMPTS.find(p => p.prompt === prompt);
965if (starterPrompt) {
1006}
10071008export default async function cerebras_coder(req: Request): Promise<Response> {
1009// Dynamic import for SQLite to avoid client-side import
1010const { sqlite } = await import("https://esm.town/v/stevekrouse/sqlite");
1109<meta property="og:site_name" content="Cerebras Coder">
1110<meta property="og:url" content="https://cerebrascoder.com"/>
1111<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."">
1112<meta property="og:type" content="website">
1113<meta property="og:image" content="https://stevekrouse-blob_admin.web.val.run/api/public/CerebrasCoderOG.jpg">
quoteExtractormain.tsx3 matches
9}
1011function App() {
12const [text, setText] = useState('');
13const [quotes, setQuotes] = useState<QuoteResult[]>([]);
142}
143144function client() {
145createRoot(document.getElementById("root")).render(<App />);
146}
147if (typeof document !== "undefined") { client(); }
148149export default async function server(request: Request): Promise<Response> {
150if (request.method === 'POST' && request.url.endsWith('/extract')) {
151const { OpenAI } = await import("https://esm.town/v/std/openai");
newFavoriteSongBotmain.tsx4 matches
45});
4647// Helper function to upload an image and get a blob reference
48async function uploadImage(agent: AtpAgent, imageUrl: string) {
49try {
50// Fetch the image
70}
7172// This is simply the val.town entry function for cron vals.
73export default async function(interval: Interval) {
74if (!newSongs) return;
75// Don't forget to set these environment variables in the val's settings.
seamlessAquamarineAntlionmain.tsx11 matches
89};
9091function LanguageProvider({ children }) {
92const [language, setLanguage] = useState('fr');
93103}
104105function useTranslation() {
106const { language } = useContext(LanguageContext);
107return (key) => translations[language][key] || key;
108}
109110function Navigation() {
111const { language, toggleLanguage } = useContext(LanguageContext);
112const t = useTranslation();
133}
134135function HomePage() {
136const t = useTranslation();
137const testimonials = [
205}
206207function ServicesPage() {
208const t = useTranslation();
209244}
245246function AboutPage() {
247const t = useTranslation();
248264}
265266function ContactPage() {
267const t = useTranslation();
268const [formData, setFormData] = useState({
316}
317318function Footer() {
319const t = useTranslation();
320353}
354355function App() {
356return (
357<LanguageProvider>
370}
371372function client() {
373createRoot(document.getElementById("root")).render(<App />);
374}
378}
379380export default async function server(request: Request): Promise<Response> {
381return new Response(`
382<!DOCTYPE html>