cerebras_coderindex7 matches
23);
2425function Hero({
26prompt,
27setPrompt,
4445<p className="text-[#bababa] text-center max-w-[25ch] mx-auto my-4 font-dm-sans">
46Turn your ideas into fully functional apps in{" "}
47<span className="relative w-fit text-fuchsia-400 z-10 italic font-semibold rounded-full">
48less than a second
115}
116117function App() {
118const previewRef = React.useRef<HTMLDivElement>(null);
119const [prompt, setPrompt] = useState("");
169});
170171function handleStarterPromptClick(promptItem: typeof prompts[number]) {
172setLoading(true);
173setTimeout(() => handleSubmit(promptItem.prompt), 0);
174}
175176async function handleSubmit(e: React.FormEvent | string) {
177if (typeof e !== "string") {
178e.preventDefault();
225}
226227function handleVersionChange(direction: "back" | "forward") {
228const { currentVersionIndex, versions } = versionHistory;
229if (direction === "back" && currentVersionIndex > 0) {
973);
974975function client() {
976const path = window.location.pathname;
977const root = createRoot(document.getElementById("root")!);
cerebras_codergenerate-code2 matches
2import STARTER_PROMPTS from "../public/starter-prompts.js";
34function extractCodeFromFence(text: string): string {
5const htmlMatch = text.match(/```html\n([\s\S]*?)\n```/);
6return htmlMatch ? htmlMatch[1].trim() : text;
7}
89export async function generateCode(prompt: string, currentCode: string) {
10const starterPrompt = STARTER_PROMPTS.find(p => p.prompt === prompt);
11if (starterPrompt) {
1export default async function (req: Request): Promise<Response> {
2return Response.json({ ok: true })
3}
13];
1415function App() {
16const [noClicks, setNoClicks] = useState(0);
17const [isValentine, setIsValentine] = useState(false);
98}
99100function client() {
101createRoot(document.getElementById("root")).render(<App />);
102}
103if (typeof document !== "undefined") { client(); }
104105export default async function server(request: Request): Promise<Response> {
106return new Response(
107`
genuineBrownBoobymain.tsx11 matches
3import ReactDOM from "https://esm.sh/react-dom@18.2.0/client";
45// Utility Functions
6const HABIT_ICONS = {
7fitness: "๐ช", reading: "๐", meditation: "๐ง",
1718// AI-Powered Motivation Generation
19async function generateMotivation(userProgress) {
20try {
21const { OpenAI } = await import("https://esm.town/v/std/openai");
3839// Voice Input Component
40function VoiceInput({ onComplete }) {
41const [isListening, setIsListening] = useState(false);
42const recognitionRef = useRef(null);
9798// Main Habit Tracker Component
99function HabitTracker() {
100const [habits, setHabits] = useState([]);
101const [newHabit, setNewHabit] = useState('');
116}, [darkMode]);
117118async function fetchHabits() {
119try {
120const response = await fetch('/get-habits');
128}
129130function calculateUserProgress(habitList) {
131const totalHabits = habitList.length;
132const completedHabits = habitList.filter(h => h.streak > 0).length;
151}
152153async function addHabit() {
154if (!newHabit.trim()) return;
155173}
174175async function completeHabit(habitId) {
176try {
177const response = await fetch('/complete-habit', {
189}
190191function determineBadge(streak) {
192if (streak >= BADGE_THRESHOLDS.legend) return "๐ Legend";
193if (streak >= BADGE_THRESHOLDS.champion) return "๐ฅ Champion";
287288// Client initialization with error handling
289function client() {
290try {
291const rootElement = document.getElementById("root");
305}
306307export default async function server(request: Request): Promise<Response> {
308const { sqlite } = await import("https://esm.town/v/stevekrouse/sqlite");
309const KEY = "genuineBrownBooby";
habitTrackerAppmain.tsx11 matches
3import ReactDOM from "https://esm.sh/react-dom@18.2.0/client";
45// Utility Functions
6const HABIT_ICONS = {
7fitness: "๐ช", reading: "๐", meditation: "๐ง",
1718// AI-Powered Motivation Generation
19async function generateMotivation(userProgress) {
20try {
21const { OpenAI } = await import("https://esm.town/v/std/openai");
3839// Voice Input Component
40function VoiceInput({ onComplete }) {
41const [isListening, setIsListening] = useState(false);
42const recognitionRef = useRef(null);
9798// Main Habit Tracker Component
99function HabitTracker() {
100const [habits, setHabits] = useState([]);
101const [newHabit, setNewHabit] = useState('');
116}, [darkMode]);
117118async function fetchHabits() {
119try {
120const response = await fetch('/get-habits');
128}
129130function calculateUserProgress(habitList) {
131const totalHabits = habitList.length;
132const completedHabits = habitList.filter(h => h.streak > 0).length;
151}
152153async function addHabit() {
154if (!newHabit.trim()) return;
155173}
174175async function completeHabit(habitId) {
176try {
177const response = await fetch('/complete-habit', {
189}
190191function determineBadge(streak) {
192if (streak >= BADGE_THRESHOLDS.legend) return "๐ Legend";
193if (streak >= BADGE_THRESHOLDS.champion) return "๐ฅ Champion";
287288// Client initialization with error handling
289function client() {
290try {
291const rootElement = document.getElementById("root");
305}
306307export default async function server(request: Request): Promise<Response> {
308const { sqlite } = await import("https://esm.town/v/stevekrouse/sqlite");
309const KEY = "habitTrackerApp";
2import { useState } from "https://esm.sh/react@18.2.0";
34export function App() {
5const [projectUrl, setProjectUrl] = useState("");
6const [apiToken, setApiToken] = useState("");
cabinAdjacentTweetsmain.tsx14 matches
115const openai = new OpenAI();
116117async function isTweetProcessed(tweetId: string): Promise<boolean> {
118const result = await sqlite.execute({
119sql: "SELECT tweetId FROM cabinAdjacentTweets WHERE tweetId = :tweetId",
123}
124125async function markTweetAsProcessed(tweetId: string, tweetText: string): Promise<void> {
126await sqlite.execute({
127sql:
135}
136137// Core API functions
138async function searchTweets(query: string, startTime: Date): Promise<Tweet[]> {
139try {
140console.log(`Making request to socialdata API with query: ${query}`);
199}
200201async function getUserTweets(username: string, startTime: Date): Promise<Tweet[]> {
202try {
203// For user tweets, we can use the search endpoint with from: operator
259}
260261// Search functions
262const KEYWORD_CHUNKS = [
263"\"improve community\" OR \"improve neighborhood\" OR \"best neighborhood\" OR \"friends far\" OR \"walkable neighborhood\"",
267];
268269async function scanKeywords(startTime: Date): Promise<Tweet[]> {
270console.log("Starting keyword scan...");
271const allTweets: Tweet[] = [];
287}
288289async function scanAccounts(startTime: Date): Promise<Tweet[]> {
290console.log("Starting account scan...");
291const BATCH_SIZE = 5;
312313// Retry helper with exponential backoff
314async function retryWithBackoff<T>(
315operation: () => Promise<T>,
316maxRetries: number = 5,
337338// Assessment and processing
339async function assessTweet(tweet: string): Promise<Assessment> {
340try {
341const completion = await retryWithBackoff(() =>
401}
402403async function sendToDiscord(tweet: Tweet, webhookUrl: string): Promise<void> {
404const content = `https://x.com/${tweet.user.screen_name}/status/${tweet.id_str}`;
405await discordWebhook({
410411// Main processing pipeline
412async function processTweets(tweets: Tweet[]) {
413for (const tweet of tweets) {
414try {
439}
440441// Main function
442export async function twitterAlert({ lastRunAt }: { lastRunAt: string }) {
443console.log("Starting Twitter alert scan...");
444const startTime = new Date(Date.parse(lastRunAt) - 1000 * 60 * 60);