spagUploadmain.tsx1 match
2import { sqlite } from "https://esm.town/v/stevekrouse/sqlite";
34export default async function(req: Request): Promise<Response> {
5let json;
6try {
spagDeletemain.tsx1 match
2import { sqlite } from "https://esm.town/v/stevekrouse/sqlite";
34export default async function(req: Request): Promise<Response> {
5let json;
6try {
1import { sqlite } from "https://esm.town/v/stevekrouse/sqlite";
23export default async function(req: Request): Promise<Response> {
4// Get all rows from lab_upload_blobs
5const response = await sqlite.execute(`
seamlessCoffeeCobramain.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">
FetchBasicmain.tsx1 match
1export default async function(req: Request): Promise<Response> {
2// Setup CORS Headers
3const headers = new Headers();
89```
10async function calculateEmbeddings(text) {
11const url = `https://yawnxyz-ai.web.val.run/generate?embed=true&value=${encodeURIComponent(text)}`;
12
213214if (toolResults && toolResults.length > 0) {
215// we have to do this bc the AI SDK doesn't seem to let you carry over function calling results,
216// so we pretend to be the user instead of using the official role: tool API, which breaks everything
217for (const toolResult of toolResults) {
670}
671672function test() {
673console.log("test!")
674}
multiplayerCirclesmain.tsx6 matches
37// });
3839function parseResultSet<T>(row: ResultSet): T[] {
40return row.rows.map((r) => Object.fromEntries(r.map((c, i) => [row.columns[i], c]))) as T[];
41}
51};
5253function diffCircles(array1: Circle[], array2: Circle[]): Circle[] {
54const changes: Circle[] = [];
557475const drag = (() => {
76function dragstarted() {
77d3.select(this).attr("stroke", "black");
78}
7980function dragged(event, d) {
81d3.select(this).raise().attr("cx", d.x = event.x).attr("cy", d.y = event.y);
82}
8384function dragended() {
85const x = d3.select(this).attr("cx");
86const y = d3.select(this).attr("cy");
105.call(drag)
106.on("click", clicked);
107function clicked(event, d) {
108if (event.defaultPrevented) return; // dragged
109
vbloghono-adapter6 matches
7const app = new Hono();
89function Style() {
10return <style>{`body{margin:0;padding:32px;font-family:Menlo, monospace}`}</style>;
11}
1213function Home(data: Data, c: Context) {
14return (
15<div>
29}
3031function Post(data: Data, c: Context) {
32const name = c.req.param("post");
33const post = data.posts.find(p => p.name === name);
46}
4748function NotFound(data: Data, c: Context) {
49const name = c.req.param("post");
50return (
59type RouteComponent = (data: Data, context: Context<any, any, {}>) => JSX.Element;
6061function route(Component: RouteComponent, data: Data) {
62return async (c) => c.html(Component(data, c));
63}
6465export default function honoAdapter(data: Data) {
66app.get("/", route(Home, data));
67app.get("/posts/:post", route(Post, data));