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">
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">
1export default async function (req: Request): Promise<Response> {
2return Response.json({ ok: true })
3}
5const storageKey = "germanCovidSewageDataUpdates-lastKnownUpdate";
67export async function handler(interval: Interval) {
8const lastKnownUpdate = await blob.getJSON(storageKey) || "";
9
3import { createRoot } from "https://esm.sh/react-dom@18.2.0/client";
45function App() {
6return (
7<div className="container">
26}
2728function client() {
29createRoot(document.getElementById("root")).render(<App />);
3039if (typeof document !== "undefined") { client(); }
4041export default async function server(request: Request): Promise<Response> {
42return new Response(`
43<html>
1export default async function server(request: Request): Promise<Response> {
2return new Response(`
3<!DOCTYPE html>
513});
514515// Notes functionality
516this.elements.notesBtn.addEventListener('click', () => this.showNotesModal());
517this.elements.saveNotesBtn.addEventListener('click', () => {
522this.elements.overlay.addEventListener('click', () => this.hideNotesModal());
523524// Print functionality
525this.elements.printBtn.addEventListener('click', () => {
526window.print();
SolanaJupiterTxParsermain.tsx2 matches
29]);
3031function isBytesEqual(a: Uint8Array, b: Uint8Array) {
32if (a.length !== b.length) {
33return false;
43const rpc = createSolanaRpc("https://api.mainnet-beta.solana.com");
4445async function getSwapEvent(txId: Signature) {
46const rpcTx = await rpc
47.getTransaction(txId, {
flowingBeigePigeonmain.tsx3 matches
40};
4142function WildlifeRescueApp() {
43const [image, setImage] = useState<string | null>(null);
44const [location, setLocation] = useState<{
494};
495496function client() {
497createRoot(document.getElementById("root")).render(<WildlifeRescueApp />);
498}
499if (typeof document !== "undefined") { client(); }
500501export default async function server(request: Request): Promise<Response> {
502return new Response(`
503<html>
wildlifeRescueAppmain.tsx3 matches
3import { createRoot } from "https://esm.sh/react-dom@18.2.0/client";
45function WildlifeRescueApp() {
6const [image, setImage] = useState<{ file: File | null, preview: string }>({ file: null, preview: '' });
7const [location, setLocation] = useState<{ lat: number; lng: number }>({ lat: 0, lng: 0 });
246}
247248function client() {
249createRoot(document.getElementById("root")).render(<WildlifeRescueApp />);
250}
251if (typeof document !== "undefined") { client(); }
252253export default async function server(request: Request): Promise<Response> {
254return new Response(`
255<html>
blob_adminmain.tsx8 matches
13}
1415function Tooltip({ children, content }: TooltipProps) {
16const [isVisible, setIsVisible] = useState(false);
17const tooltipRef = useRef<HTMLDivElement>(null);
52}
5354function formatBytes(bytes: number, decimals = 2) {
55if (bytes === 0) return "0 Bytes";
56const k = 1024;
61}
6263function copyToClipboard(text: string) {
64navigator.clipboard.writeText(text).then(() => {
65console.log("Text copied to clipboard");
69}
7071function ActionMenu({ blob, onDownload, onRename, onDelete, onMoveToPublic, onMoveOutOfPublic }) {
72const [isOpen, setIsOpen] = useState(false);
73const menuRef = useRef(null);
7677useEffect(() => {
78function handleClickOutside(event) {
79if (menuRef.current && !menuRef.current.contains(event.target)) {
80event.stopPropagation();
158}
159160function BlobItem({ blob, onSelect, isSelected, onDownload, onRename, onDelete, onMoveToPublic, onMoveOutOfPublic }) {
161const [isLoading, setIsLoading] = useState(false);
162const decodedKey = decodeURIComponent(blob.key);
219}
220221function App({ initialEmail, initialProfile }) {
222const encodeKey = (key: string) => encodeURIComponent(key);
223const decodeKey = (key: string) => decodeURIComponent(key);
645}
646647function client() {
648const initialEmail = document.getElementById("root").getAttribute("data-email");
649const initialProfile = JSON.parse(document.getElementById("root").getAttribute("data-profile"));