notUber_migratedmain.tsx10 matches
35import { Rides } from "https://esm.town/v/vawogbemi/notUberRides";
3637function Container({ children }) {
38return (
39<div className="w-full md:max-w-7xl md:mx-auto md:px-4 lg:px-8">
43}
4445function MobileNav() {
46const location = useLocation();
4792}
9394function DesktopNav() {
95const navigate = useNavigate();
96const location = useLocation();
138}
139140function UnauthenticatedApp() {
141return (
142<div className="flex flex-col min-h-screen bg-white">
154}
155156function Modal({ isOpen, onClose, children }) {
157if (!isOpen) return null;
158166}
167168function AuthenticatedApp() {
169const db = init({ appId: INSTANTDB_APP_ID });
170const [modalOpen, setModalOpen] = useState(false);
384}
385386function App() {
387return (
388<Router>
399}
400401function client() {
402createRoot(document.getElementById("root")).render(<App />);
403}
407}
408409export default async function server(request: Request): Promise<Response> {
410console.log("Server function called");
411412return new Response(
emailToDiscordhttpHandler2 matches
14}
1516export function getHttpHandler(
17{ blobKeyPrefix, enforceDiscordAgent }: IHttpHandlerProps,
18): (req: Request) => Promise<Response> {
19return async function(req: Request): Promise<Response> {
20console.log(req);
21if (req.method !== "GET") {
adroitIvoryEchidnamain.tsx6 matches
4142// Haversine formula for distance calculation
43function calculateDistance(
44lat1: number,
45lon1: number,
58}
5960function TravelGuideApp() {
61const [location, setLocation] = useState<{
62latitude: number | null,
74const recommendationsSectionRef = useRef<HTMLDivElement>(null);
7576// Geocoding function to convert location name to coordinates
77const geocodeLocation = async (query: string) => {
78try {
421}
422423// Client-side rendering function
424function client() {
425createRoot(document.getElementById("root")).render(<TravelGuideApp />);
426}
432433// Server-side export
434export default async function server(request: Request): Promise<Response> {
435if (request.method === 'POST' && request.url.includes('/recommendations')) {
436const { OpenAI } = await import("https://esm.town/v/std/openai");
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">
accomplishedAzureAardvarkmain.tsx3 matches
3import React, { useState } from "https://esm.sh/react@18.2.0";
45function LoanCalculator() {
6const [loanAmount, setLoanAmount] = useState(100000);
7const [interestRate, setInterestRate] = useState(5);
121};
122123function client() {
124createRoot(document.getElementById("root")).render(<LoanCalculator />);
125}
127if (typeof document !== "undefined") { client(); }
128129export default async function server(request: Request): Promise<Response> {
130return new Response(
131`
1export default async function (req: Request): Promise<Response> {
2return Response.json({ ok: true })
3}
ArifioforgivingTanPig1 match
1export default async function (req: Request): Promise<Response> {
2return Response.json({ ok: true })
3}
gregariousPinkCatmain.tsx1 match
1export default async function (req: Request): Promise<Response> {
2return Response.json({ ok: true })
3}
loanCalculatormain.tsx3 matches
3import React, { useState } from "https://esm.sh/react@18.2.0";
45function LoanCalculator() {
6const [loanAmount, setLoanAmount] = useState(100000);
7const [interestRate, setInterestRate] = useState(5);
121};
122123function client() {
124createRoot(document.getElementById("root")).render(<LoanCalculator />);
125}
127if (typeof document !== "undefined") { client(); }
128129export default async function server(request: Request): Promise<Response> {
130return new Response(
131`