brilliantChocolateElkmain.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">
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">
zSTYLES_elatedOrangeMonkeymain.tsx9 matches
22`;
2324function parseCSV(csv) {
25const result = Papa.parse(csv, {
26header: true,
35}
3637function App() {
38const [darkMode, setDarkMode] = useState(false);
39const [linkData, setLinkData] = useState([]);
50const toggleSettings = () => setShowSettings(!showSettings);
5152function updateLinkList() {
53const linkList = document.getElementById('link-list');
54linkList.innerHTML = '';
102}
103104function saveToLocalStorage() {
105localStorage.setItem('linkData', JSON.stringify(linkData));
106localStorage.setItem('csvData', csvData);
108}
109110function loadFromLocalStorage() {
111const savedLinkData = localStorage.getItem('linkData');
112const savedCsvData = localStorage.getItem('csvData');
126}
127128function updateLineCount() {
129const lines = csvData.split('\n').length;
130return `Lines: ${lines}`;
131}
132133function showUpdateMessage(message, type) {
134// Implementation depends on how you want to show messages in React
135console.log(`${type}: ${message}`);
282}
283284function client() {
285createRoot(document.getElementById("root")).render(<App />);
286}
290}
291292export default async function server(request: Request): Promise<Response> {
293return new Response(`
294<!DOCTYPE html>
loanCalculatorAppmain.tsx4 matches
3import { createRoot } from "https://esm.sh/react-dom@18.2.0/client";
45function LoanCalculator() {
6const [principal, setPrincipal] = useState('');
7const [rate, setRate] = useState('');
102}
103104function App() {
105return <LoanCalculator />;
106}
107108function client() {
109createRoot(document.getElementById("root")).render(<App />);
110}
111if (typeof document !== "undefined") { client(); }
112113export default async function server(request: Request): Promise<Response> {
114return new Response(`
115<html>
63This val uses the SocialData API for Twitter data:
64- **Proxies via Val Town's SocialDataProxy**: Limited to 100 calls/day for [**Val Town Pro users**](https://www.val.town/pricing).
65- **Need more calls?** Sign up for your own [SocialData API token](https://socialdata.tools) and configure the [`socialDataSearch`](https://www.val.town/v/stevekrouse/socialDataSearch) function.
10const isProd = true;
1112export async function twitterAlert({ lastRunAt }: Interval) {
13// Scrapes data from past 48 hours time frame if testing
14const timeFrame = isProd
63This val uses the SocialData API for Twitter data:
64- **Proxies via Val Town's SocialDataProxy**: Limited to 100 calls/day for [**Val Town Pro users**](https://www.val.town/pricing).
65- **Need more calls?** Sign up for your own [SocialData API token](https://socialdata.tools) and configure the [`socialDataSearch`](https://www.val.town/v/stevekrouse/socialDataSearch) function.
10const isProd = true;
1112export async function twitterAlert({ lastRunAt }: Interval) {
13// Scrapes data from past 48 hours time frame if testing
14const timeFrame = isProd
1import safeJsonValue from "npm:safe-json-value";
23export async function evalCode(
4code: string,
5): Promise<{ error: { message: string; name: string; stack: string } } | any> {
43}
4445function getMainExport(
46mod: any,
47): { ok: true; value: any } | { ok: false; error: Error } {