64};
6566export default async function(req: Request): Promise<Response> {
67if (req.method === "GET") {
68// handle a GET request
64};
6566export default async function(req: Request): Promise<Response> {
67if (req.method === "GET") {
68// handle a GET request
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">
64};
6566export default async function(req: Request): Promise<Response> {
67if (req.method === "GET") {
68// handle a GET request
22<canvas id="matrixRain"></canvas>
23<script>
24(function () {
25const canvas = document.getElementById("matrixRain");
26const ctx = canvas.getContext("2d");
incredibleYellowTickmain.tsx1 match
42export type Data = BooleanData | TextData | ImageData | SpeechData | WebsiteData;
4344export default async function(req: Request): Promise<Response> {
45try {
46const { version, inputs } = await req.json() as { version: number; inputs: Data[] };
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"));
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">
notUberMapComponentmain.tsx15 matches
5const GOOGLE_MAPS_API_KEY = "AIzaSyAOtUMb5jLTjTVM7iKzIx2SJ3HgMKNcM7U";
67function debounce(func, wait) {
8let timeout;
9return function executedFunction(...args) {
10const later = () => {
11clearTimeout(timeout);
128let googleMapsPromise = null;
129130// Function to load Google Maps API globally
131function loadGoogleMapsAPI() {
132if (googleMapsPromise) {
133return googleMapsPromise;
163}
164165export function MapComponent(
166{ pickupLocation, dropoffLocation, active, showZoomControl }: {
167pickupLocation: string | null;
224}, [active, pickupLocation, dropoffLocation, pathCoordinates, mapFullyLoaded]);
225226function initMap() {
227try {
228if (!window.google || !window.google.maps) {
266}
267268async function updateMap() {
269try {
270if (pickupMarker) pickupMarker.setMap(null);
298}
299300function setMarkerAndCenter(location, type) {
301return new Promise((resolve, reject) => {
302if (!window.google || !window.google.maps) {
334}
335336function createCustomMarker(type, size = 24) {
337const outerColor = "#ffffff";
338const innerColor = "#121212";
359}
360361function drawRoute(start, end) {
362return new Promise((resolve, reject) => {
363if (!directionsServiceRef.current) {
390}
391392function fitRouteBounds() {
393if (directionsRendererRef.current && directionsRendererRef.current.getDirections()) {
394const bounds = new window.google.maps.LatLngBounds();
405}
406407function startAnimation() {
408if (animationRef.current) return;
409if (!window.google || !window.google.maps || !map) {
430const numSteps = 200; // You can adjust this for smoother or faster animation
431432function animate() {
433const path = animatedPolylineRef.current.getPath();
434path.push(pathCoordinates[step]);
448}
449450function stopAnimation() {
451if (animationRef.current) {
452window.cancelAnimationFrame(animationRef.current);
468}
469470export function AutocompleteInput(
471{ value, onChange, placeholder, icon: Icon }: {
472value: string;
getLatestGitHubRunmain.tsx1 match
1export async function handler(request: Request) {
2const url = new URL(request.url);
3const items = url.pathname.slice(1).split("/");