sqliteExplorerAppREADME.md1 match
3View and interact with your Val Town SQLite data. It's based off Steve's excellent [SQLite Admin](https://www.val.town/v/stevekrouse/sqlite_admin?v=46) val, adding the ability to run SQLite queries directly in the interface. This new version has a revised UI and that's heavily inspired by [LibSQL Studio](https://github.com/invisal/libsql-studio) by [invisal](https://github.com/invisal). This is now more an SPA, with tables, queries and results showing up on the same page.
45
67## Install
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">
1168
1169
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">
1168
1169
password_authREADME.md1 match
3Protect your vals behind a password. Use session cookies to persist authentication.
45
67## Usage
cerebras_codermain.tsx32 matches
8const [tackleBox, setTackleBox] = useState([]);
9const [recommendation, setRecommendation] = useState("");
10const [lureImageUrl, setLureImageUrl] = useState("");
1112useEffect(() => {
159const lureName = event.target.elements["lure-name"].value;
160const lureDescription = event.target.elements["lure-description"].value;
161const lureImage = event.target.elements["lure-image"].files[0];
162const lureImageUrlInput = event.target.elements["lure-image-url"].value;
163164let imageUrl = "";
165if (lureImage) {
166const formData = new FormData();
167formData.append("image", lureImage);
168try {
169const response = await fetch("/api/uploadImage", {
170method: "POST",
171body: formData,
173if (response.ok) {
174const data = await response.json();
175imageUrl = data.url;
176}
177} catch (error) {
178console.error("Error uploading image:", error);
179}
180} else if (lureImageUrlInput) {
181imageUrl = lureImageUrlInput;
182}
183184const newLure = { name: lureName, description: lureDescription, image: imageUrl };
185
186try {
195setTackleBox([...tackleBox, newLure]);
196event.target.reset();
197setLureImageUrl("");
198}
199} catch (error) {
302</div>
303<div className="mb-4">
304<label className="block text-gray-700" htmlFor="lure-image">Upload Lure/Fly Image (Optional)</label>
305<input className="w-full p-2 border border-gray-300 rounded" id="lure-image" name="lure-image" type="file" accept="image/*" />
306</div>
307<div className="mb-4">
308<label className="block text-gray-700" htmlFor="lure-image-url">Or Enter Image URL</label>
309<input
310className="w-full p-2 border border-gray-300 rounded"
311id="lure-image-url"
312name="lure-image-url"
313type="url"
314placeholder="https://example.com/image.jpg"
315value={lureImageUrl}
316onChange={(e) => setLureImageUrl(e.target.value)}
317/>
318</div>
319{lureImageUrl && (
320<div className="mb-4">
321<img src={lureImageUrl} alt="Lure preview" className="max-w-full h-auto" />
322</div>
323)}
330{tackleBox.map((lure, index) => (
331<div key={index} className="border p-4 rounded">
332{lure.image && <img src={lure.image} alt={lure.name} className="w-full h-40 object-cover mb-2 rounded" />}
333<h3 className="text-lg font-bold">{lure.name}</h3>
334<p className="text-gray-700">{lure.description}</p>
377});
378}
379} else if (url.pathname === "/api/uploadImage") {
380if (req.method === "POST") {
381const formData = await req.formData();
382const image = formData.get("image") as File;
383if (image) {
384const imageBuffer = await image.arrayBuffer();
385const imageKey = `${key}_image_${Date.now()}_${image.name}`;
386await blob.set(imageKey, imageBuffer);
387const imageUrl = `https://val.town/v1/blob/${imageKey}`;
388return new Response(JSON.stringify({ url: imageUrl }), {
389headers: { "Content-Type": "application/json" },
390});
idealJadeGerbilmain.tsx1 match
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">
1168
1169
tolerantCyanCrawdadmain.tsx1 match
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">
1168
1169
cerebras_codermain.tsx1 match
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">
1168
1169
cerebras_codermain.tsx1 match
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">
1168
1169
cerebras_codermain.tsx1 match
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">
1168
1169