cerebras_codermain.tsx5 matches
217} catch (error) {
218Toastify({
219text: "We may have hit our Cerebras Usage limits. Try again later or fork this and use your own API key.",
220position: "center",
221duration: 3000,
970};
971} else {
972const client = new Cerebras({ apiKey: Deno.env.get("CEREBRAS_API_KEY") });
973const completion = await client.chat.completions.create({
974messages: [
1095<meta name="viewport" content="width=device-width, initial-scale=1.0">
1096<title>CerebrasCoder</title>
1097<link rel="preconnect" href="https://fonts.googleapis.com" />
1098<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
1099<link
1100href="https://fonts.googleapis.com/css2?family=DM+Mono:ital,wght@0,300;0,400;0,500;1,300;1,400;1,500&family=DM+Sans:ital,opsz,wght@0,9..40,100..1000;1,9..40,100..1000&display=swap"
1101rel="stylesheet"
1102/>
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">
1114
1115
pioneeringAzureChickadeemain.tsx3 matches
38customPC: "Montage PC sur mesure",
39customPCDesc: "Créez la machine de vos rêves avec des composants haut de gamme.",
40quickSupport: "Dépannage Rapide",
41quickSupportDesc: "Résolution efficace de vos problèmes pour un temps de jeu maximal.",
42testimonials: "Témoignages Clients",
53send: "Envoyer",
54followUs: "Suivez-nous",
55quickLinks: "Liens rapides",
56allRightsReserved: "Tous droits réservés.",
57},
388<title>Assistance Informatique Gaming</title>
389<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
390<link href="https://fonts.googleapis.com/css2?family=Orbitron:wght@400;700&family=Roboto:wght@300;400;700&display=swap" rel="stylesheet">
391<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta3/css/all.min.css" rel="stylesheet">
392<style>${css}</style>
geminichatmain.tsx1 match
230await db.saveMessage("user", message);
231232const genAI = new GoogleGenerativeAI(Deno.env.get("GEMINI_API_KEY"));
233const model = "gemini-2.0-flash-exp";
234
neatChocolateLynxmain.tsx5 matches
28const testimonials = [
29{ name: "Alex G.", text: "Service exceptionnel ! Mon PC gaming fonctionne mieux que jamais." },
30{ name: "Sophie L.", text: "L'équipe a résolu mon problème rapidement. Je recommande vivement !" },
31{ name: "Thomas M.", text: "Montage PC sur mesure parfait. Exactement ce que je voulais !" },
32];
70<Card className="h-100 gaming-card">
71<Card.Body>
72<Card.Title className="gaming-card-title">Dépannage Rapide</Card.Title>
73<Card.Text>Résolution efficace de vos problèmes pour un temps de jeu maximal.</Card.Text>
74</Card.Body>
122<Card className="h-100 gaming-card">
123<Card.Body>
124<Card.Title className="gaming-card-title">Dépannage Rapide</Card.Title>
125<Card.Text>Résolution efficace de vos problèmes pour un temps de jeu maximal.</Card.Text>
126<Button variant="primary">En savoir plus</Button>
212</Col>
213<Col md={4}>
214<h5>Liens rapides</h5>
215<ul className="list-unstyled">
216<li><Link to="/" className="text-light">Accueil</Link></li>
270<title>Assistance Informatique Gaming</title>
271<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
272<link href="https://fonts.googleapis.com/css2?family=Orbitron:wght@400;700&family=Roboto:wght@300;400;700&display=swap" rel="stylesheet">
273<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta3/css/all.min.css" rel="stylesheet">
274<style>${css}</style>
scholarlyRedWhalemain.tsx5 matches
28const testimonials = [
29{ name: "Alex G.", text: "Service exceptionnel ! Mon PC gaming fonctionne mieux que jamais." },
30{ name: "Sophie L.", text: "L'équipe a résolu mon problème rapidement. Je recommande vivement !" },
31{ name: "Thomas M.", text: "Montage PC sur mesure parfait. Exactement ce que je voulais !" },
32];
70<Card className="h-100 gaming-card">
71<Card.Body>
72<Card.Title className="gaming-card-title">Dépannage Rapide</Card.Title>
73<Card.Text>Résolution efficace de vos problèmes pour un temps de jeu maximal.</Card.Text>
74</Card.Body>
122<Card className="h-100 gaming-card">
123<Card.Body>
124<Card.Title className="gaming-card-title">Dépannage Rapide</Card.Title>
125<Card.Text>Résolution efficace de vos problèmes pour un temps de jeu maximal.</Card.Text>
126<Button variant="primary">En savoir plus</Button>
212</Col>
213<Col md={4}>
214<h5>Liens rapides</h5>
215<ul className="list-unstyled">
216<li><Link to="/" className="text-light">Accueil</Link></li>
270<title>Assistance Informatique Gaming</title>
271<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
272<link href="https://fonts.googleapis.com/css2?family=Orbitron:wght@400;700&family=Roboto:wght@300;400;700&display=swap" rel="stylesheet">
273<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta3/css/all.min.css" rel="stylesheet">
274<style>${css}</style>
910if (isImage) {
11const imageUrl = `https://api.apiflash.com/v1/urltoimage?access_key=${
12Deno.env.get("APIFLASH_API_KEY")
13}&url=${url.origin}&format=png&width=1200&height=800&scale_factor=2`;
14// const imageUrl = "https://charlypoly-httpapiscreenshotpageexample.web.val.run/?url=" + url.origin;
15// return Response.redirect(imageUrl, 302)
16const res = await fetch(imageUrl);
weatherAppmain.tsx2 matches
17try {
18const response = await fetch(
19`https://api.open-meteo.com/v1/forecast?latitude=${lat}&longitude=${lon}¤t_weather=true&hourly=temperature_2m,relativehumidity_2m,windspeed_10m`,
20);
21const data = await response.json();
45try {
46const geocodeResponse = await fetch(
47`https://geocoding-api.open-meteo.com/v1/search?name=${
48encodeURIComponent(searchQuery)
49}&count=1&language=en&format=json`,
cerebras_codermain.tsx5 matches
217} catch (error) {
218Toastify({
219text: "We may have hit our Cerebras Usage limits. Try again later or fork this and use your own API key.",
220position: "center",
221duration: 3000,
1050};
1051} else {
1052const client = new Cerebras({ apiKey: Deno.env.get("CEREBRAS_API_KEY") });
1053const completion = await client.chat.completions.create({
1054messages: [
1175<meta name="viewport" content="width=device-width, initial-scale=1.0">
1176<title>CerebrasCoder</title>
1177<link rel="preconnect" href="https://fonts.googleapis.com" />
1178<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
1179<link
1180href="https://fonts.googleapis.com/css2?family=DM+Mono:ital,wght@0,300;0,400;0,500;1,300;1,400;1,500&family=DM+Sans:ital,opsz,wght@0,9..40,100..1000;1,9..40,100..1000&display=swap"
1181rel="stylesheet"
1182/>
1191<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."">
1192<meta property="og:type" content="website">
1193<meta property="og:image" content="https://stevekrouse-blob_admin.web.val.run/api/public/CerebrasCoderOG.jpg">
1194
1195
cerebras_coderREADME.md2 matches
671. Sign up for [Cerebras](https://cloud.cerebras.ai/)
82. Get a Cerebras API Key
93. Save it in a [Val Town environment variable](https://www.val.town/settings/environment-variables) called `CEREBRAS_API_KEY`
blobStoragemain.tsx25 matches
73const menuRef = useRef(null);
74const isPublic = blob.key.startsWith("__public/");
75const publicUrl = isPublic ? `${window.location.origin}/api/public/${encodeURIComponent(blob.key.slice(9))}` : null;
7677useEffect(() => {
237setLoading(true);
238try {
239const response = await fetch(`/api/blobs?prefix=${encodeKey(searchPrefix)}&limit=${limit}`);
240const data = await response.json();
241setBlobs(data);
264setBlobContentLoading(true);
265try {
266const response = await fetch(`/api/blob?key=${encodeKey(clickedBlob.key)}`);
267const content = await response.text();
268setSelectedBlob({ ...clickedBlob, key: decodeKey(clickedBlob.key) });
278const handleSave = async () => {
279try {
280await fetch(`/api/blob?key=${encodeKey(selectedBlob.key)}`, {
281method: "PUT",
282body: editContent,
290const handleDelete = async (key) => {
291try {
292await fetch(`/api/blob?key=${encodeKey(key)}`, { method: "DELETE" });
293setBlobs(blobs.filter(b => b.key !== key));
294if (selectedBlob && selectedBlob.key === key) {
307const key = `${searchPrefix}${file.name}`;
308formData.append("key", encodeKey(key));
309await fetch("/api/blob", { method: "POST", body: formData });
310const newBlob = { key, size: file.size, lastModified: new Date().toISOString() };
311setBlobs([newBlob, ...blobs]);
329try {
330const fullKey = `${searchPrefix}${key}`;
331await fetch(`/api/blob?key=${encodeKey(fullKey)}`, {
332method: "PUT",
333body: "",
344const handleDownload = async (key) => {
345try {
346const response = await fetch(`/api/blob?key=${encodeKey(key)}`);
347const blob = await response.blob();
348const url = window.URL.createObjectURL(blob);
363if (newKey && newKey !== oldKey) {
364try {
365const response = await fetch(`/api/blob?key=${encodeKey(oldKey)}`);
366const content = await response.blob();
367await fetch(`/api/blob?key=${encodeKey(newKey)}`, {
368method: "PUT",
369body: content,
370});
371await fetch(`/api/blob?key=${encodeKey(oldKey)}`, { method: "DELETE" });
372setBlobs(blobs.map(b => b.key === oldKey ? { ...b, key: newKey } : b));
373if (selectedBlob && selectedBlob.key === oldKey) {
383const newKey = `__public/${key}`;
384try {
385const response = await fetch(`/api/blob?key=${encodeKey(key)}`);
386const content = await response.blob();
387await fetch(`/api/blob?key=${encodeKey(newKey)}`, {
388method: "PUT",
389body: content,
390});
391await fetch(`/api/blob?key=${encodeKey(key)}`, { method: "DELETE" });
392setBlobs(blobs.map(b => b.key === key ? { ...b, key: newKey } : b));
393if (selectedBlob && selectedBlob.key === key) {
402const newKey = key.slice(9); // Remove "__public/" prefix
403try {
404const response = await fetch(`/api/blob?key=${encodeKey(key)}`);
405const content = await response.blob();
406await fetch(`/api/blob?key=${encodeKey(newKey)}`, {
407method: "PUT",
408body: content,
409});
410await fetch(`/api/blob?key=${encodeKey(key)}`, { method: "DELETE" });
411setBlobs(blobs.map(b => b.key === key ? { ...b, key: newKey } : b));
412if (selectedBlob && selectedBlob.key === key) {
557onClick={() =>
558copyToClipboard(
559`${window.location.origin}/api/public/${encodeURIComponent(selectedBlob.key.slice(9))}`,
560)}
561className="text-blue-400 hover:text-blue-300 text-sm"
580>
581<img
582src={`/api/blob?key=${encodeKey(selectedBlob.key)}`}
583alt="Blob content"
584className="max-w-full h-auto"
660661// Public route without authentication
662app.get("/api/public/:id", async (c) => {
663const key = `__public/${c.req.param("id")}`;
664const { blob } = await import("https://esm.town/v/std/blob");
766};
767768app.get("/api/blobs", checkAuth, async (c) => {
769const prefix = c.req.query("prefix") || "";
770const limit = parseInt(c.req.query("limit") || "20", 10);
775});
776777app.get("/api/blob", checkAuth, async (c) => {
778const key = c.req.query("key");
779if (!key) return c.text("Missing key parameter", 400);
783});
784785app.put("/api/blob", checkAuth, async (c) => {
786const key = c.req.query("key");
787if (!key) return c.text("Missing key parameter", 400);
792});
793794app.delete("/api/blob", checkAuth, async (c) => {
795const key = c.req.query("key");
796if (!key) return c.text("Missing key parameter", 400);
800});
801802app.post("/api/blob", checkAuth, async (c) => {
803const { file, key } = await c.req.parseBody();
804if (!file || !key) return c.text("Missing file or key", 400);