contentTemplateAppmain.tsx10 matches
44}
4546function ContentTemplateApp() {
47const [content, setContent] = useState<AirtableRecord[]>([]);
48const [loading, setLoading] = useState(true);
229}
230231function client() {
232createRoot(document.getElementById("root")).render(<ContentTemplateApp />);
233}
237}
238239export default async function server(req: Request): Promise<Response> {
240const url = new URL(req.url);
241356import ContentTemplateApp from 'https://esm.town/v/awhitter/contentTemplateApp';
357358export default function MyCustomApp() {
359return (
360<div>
368// Example 2: Making an API call to /api/content endpoint
369/*
370async function fetchContent() {
371try {
372const response = await fetch('https://awhitter-contenttemplateapp.web.val.run/api/content');
388import ContentTemplateApp from 'https://esm.town/v/awhitter/contentTemplateApp';
389390function CustomLayout() {
391return (
392<div>
433import { Data, animate, Override, Animatable } from "framer"
434435// This function fetches the content from the API
436async function fetchContent() {
437try {
438const response = await fetch('https://awhitter-contenttemplateapp.web.val.run/api/content')
446447// This is your Framer component
448export function ContentDisplay(): Override {
449const [content, setContent] = Data.useState([])
450473}
474475function ContentItem({ title, description, image }) {
476return {
477width: 300,
299300if (toolResults && toolResults.length > 0) {
301// we have to do this bc the AI SDK doesn't seem to let you carry over function calling results,
302// so we pretend to be the user instead of using the official role: tool API, which breaks everything
303for (const toolResult of toolResults) {
781};
782783function test() {
784console.log("test!");
785}
89```
10async function calculateEmbeddings(text) {
11const url = `https://yawnxyz-ai.web.val.run/generate?embed=true&value=${encodeURIComponent(text)}`;
12
utmostGreenJellyfishmain.tsx1 match
3const client = new ValTown();
45async function main() {
6const profile = await client.me.profile.retrieve();
7
3132// ------------
33// Functions
34// ------------
3536async function execute(statement: InStatement): Promise<ResultSet> {
37const res = await fetch(`${API_URL}/v1/sqlite/execute`, {
38method: "POST",
48}
4950async function batch(statements: InStatement[], mode?: TransactionMode): Promise<ResultSet[]> {
51const res = await fetch(`${API_URL}/v1/sqlite/batch`, {
52method: "POST",
62}
6364function createResError(body: string) {
65try {
66const e = zLibsqlError.parse(JSON.parse(body));
113*
114* The types are currently shown for types declared in a SQL table. For
115* column types of function calls, for example, an empty string is
116* returned.
117*/
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">
shiningCyanMuskoxmain.tsx2 matches
64};
6566export default async function(req: Request): Promise<Response> {
67if (req.method === "GET") {
68// handle a GET request
116}
117118async function fetchGoogleSheetAsCSV(sheetId: string) {
119const url = `https://docs.google.com/spreadsheets/d/${sheetId}/pub?output=csv`;
120
savvyEmeraldTahrmain.tsx1 match
1export default async function(req: Request): Promise<Response> {
2const headers = Array.from(req.headers.entries()).reduce((r, [k, v]) => ({ ...r, [k]: v }), {});
3const query = req.url;
cloneChatGPTmain.tsx3 matches
3import { createRoot } from "https://esm.sh/react-dom@18.2.0/client";
45function App() {
6const [messages, setMessages] = useState([]);
7const [input, setInput] = useState("");
84}
8586function client() {
87createRoot(document.getElementById("root")).render(<App />);
88}
89if (typeof document !== "undefined") { client(); }
9091export default async function server(request: Request): Promise<Response> {
92const { sqlite } = await import("https://esm.town/v/stevekrouse/sqlite");
93const { OpenAI } = await import("https://esm.town/v/std/openai");
6);
78export async function uptimeCheck(url: string) {
9let reason: string, status: number, end: number;
10let ok = true;