cerebras_codermain.tsx5 matches
212} catch (error) {
213Toastify({
214text: "We may have hit our Cerebras Usage limits. Try again later or fork this and use your own API key.",
215position: "center",
216duration: 3000,
1024};
1025} else {
1026const client = new Cerebras({ apiKey: Deno.env.get("CEREBRAS_API_KEY") });
1027const completion = await client.chat.completions.create({
1028messages: [
1149<meta name="viewport" content="width=device-width, initial-scale=1.0">
1150<title>CerebrasCoder</title>
1151<link rel="preconnect" href="https://fonts.googleapis.com" />
1152<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
1153<link
1154href="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"
1155rel="stylesheet"
1156/>
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
karate_classesmain.tsx19 matches
9798useEffect(() => {
99fetch("/api/classes")
100.then(res => res.json())
101.then(data => {
133useEffect(() => {
134console.log("Fetching class details for ID:", id);
135fetch(`/api/classes/${id}`)
136.then(res => res.json())
137.then(data => {
143if (email) {
144console.log("Checking registration status for email:", email);
145fetch(`/api/classes/${id}/registration?email=${email}`)
146.then(res => res.json())
147.then(data => {
156157const handleRegister = () => {
158fetch(`/api/classes/${id}/register`, {
159method: "POST",
160headers: { "Content-Type": "application/json" },
174175const handleCancel = () => {
176fetch(`/api/classes/${id}/cancel`, {
177method: "POST",
178headers: { "Content-Type": "application/json" },
193const handleDelete = () => {
194if (window.confirm("Are you sure you want to delete this class?")) {
195fetch(`/api/classes/${id}`, { method: "DELETE" })
196.then(() => navigate("/classes"))
197.catch(error => console.error("Error deleting class:", error));
266useEffect(() => {
267if (id) {
268fetch(`/api/classes/${id}`)
269.then(res => res.json())
270.then(data => {
289290const method = id ? "PUT" : "POST";
291const url = id ? `/api/classes/${id}` : "/api/classes";
292293fetch(url, {
415const emailList = emails.split(/[\s,]+/).filter(email => email.trim() !== "");
416417fetch(`/api/classes/${id}/bulk-add`, {
418method: "POST",
419headers: { "Content-Type": "application/json" },
470const app = new Hono();
471472app.get("/api/classes", async (c) => {
473const { sqlite } = await import("https://esm.town/v/stevekrouse/sqlite");
474const KEY = "karate_classes";
484});
485486app.get("/api/classes/:id", async (c) => {
487const { sqlite } = await import("https://esm.town/v/stevekrouse/sqlite");
488const KEY = "karate_classes";
507});
508509app.post("/api/classes", async (c) => {
510const { sqlite } = await import("https://esm.town/v/stevekrouse/sqlite");
511const KEY = "karate_classes";
527});
528529app.put("/api/classes/:id", async (c) => {
530const { sqlite } = await import("https://esm.town/v/stevekrouse/sqlite");
531const KEY = "karate_classes";
548});
549550app.delete("/api/classes/:id", async (c) => {
551const { sqlite } = await import("https://esm.town/v/stevekrouse/sqlite");
552const KEY = "karate_classes";
563});
564565app.post("/api/classes/:id/register", async (c) => {
566const { sqlite } = await import("https://esm.town/v/stevekrouse/sqlite");
567const KEY = "karate_classes";
603});
604605app.post("/api/classes/:id/cancel", async (c) => {
606const { sqlite } = await import("https://esm.town/v/stevekrouse/sqlite");
607const KEY = "karate_classes";
628});
629630app.get("/api/classes/:id/registration", async (c) => {
631const { sqlite } = await import("https://esm.town/v/stevekrouse/sqlite");
632const KEY = "karate_classes";
651});
652653app.post("/api/classes/:id/bulk-add", async (c) => {
654const { sqlite } = await import("https://esm.town/v/stevekrouse/sqlite");
655const KEY = "karate_classes";
737const isAdmin = email && ADMIN_EMAILS.includes(email);
738739if (url.pathname.startsWith("/api")) {
740return app.fetch(request);
741}
subtleAmaranthWaspmain.tsx1 match
5960const connectWebSocket = useCallback(() => {
61const ws = new WebSocket("wss://pumpportal.fun/api/data");
6263ws.onopen = () => {
OpenTowniegenerateCode.ts2 matches
2930const openai = new OpenAI({
31baseURL: "https://openrouter.ai/api/v1",
32apiKey: Deno.env.get("OPEN_ROUTER_KEY"),
33});
34console.log(messages);
twitterAlertREADME.md4 matches
31Refer to [Twitter's search operators](https://socialdata.gitbook.io/docs/twitter-tweets/retrieve-search-results-by-keyword#endpoint-parameters) to fine-tune your query.
3233### 4. Test API call
34Set `isProd = false` in the code if you are testing, to ensure there are enough tweets to display. <br>
35Toggle it back to `true` when you're ready to run this cron job in production and actuall send notifications.
6061### NOTE: Usage Limits
62This val uses the SocialData API for Twitter data:
6364- **Proxies via Val Town's [SocialDataProxy](https://www.val.town/v/stevekrouse/socialDataProxy)**: Limited to 10 cents per day for [**Val Town Pro users**](https://www.val.town/pricing). This API is *only* for Pro users.
65- **Need more calls?** Sign up for your own [SocialData API token](https://socialdata.tools) and configure the [`socialDataSearch`](https://www.val.town/v/stevekrouse/socialDataSearch) function.
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`
cerebras_codermain.tsx5 matches
212} catch (error) {
213Toastify({
214text: "We may have hit our Cerebras Usage limits. Try again later or fork this and use your own API key.",
215position: "center",
216duration: 3000,
1024};
1025} else {
1026const client = new Cerebras({ apiKey: Deno.env.get("CEREBRAS_API_KEY") });
1027const completion = await client.chat.completions.create({
1028messages: [
1149<meta name="viewport" content="width=device-width, initial-scale=1.0">
1150<title>CerebrasCoder</title>
1151<link rel="preconnect" href="https://fonts.googleapis.com" />
1152<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
1153<link
1154href="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"
1155rel="stylesheet"
1156/>
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
firstValTestmain.tsx1 match
56const replicate = new Replicate({
7auth: Deno.env.get("REPLICATE_API_TOKEN"),
8});
9
cerebras_codermain.tsx5 matches
212} catch (error) {
213Toastify({
214text: "We may have hit our Cerebras Usage limits. Try again later or fork this and use your own API key.",
215position: "center",
216duration: 3000,
1024};
1025} else {
1026const client = new Cerebras({ apiKey: Deno.env.get("CEREBRAS_API_KEY") });
1027const completion = await client.chat.completions.create({
1028messages: [
1149<meta name="viewport" content="width=device-width, initial-scale=1.0">
1150<title>CerebrasCoder</title>
1151<link rel="preconnect" href="https://fonts.googleapis.com" />
1152<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
1153<link
1154href="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"
1155rel="stylesheet"
1156/>
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_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`