12});
1314function getStripeCustomer(customerId: string) {
15return stripe.customers.retrieve(customerId);
16}
notionSiteRssmain.tsx4 matches
1import { Client } from "https://esm.sh/@notionhq/client";
23export default async function server(request: Request): Promise<Response> {
4// Retrieve Notion API token from environment variable
5const notionToken = Deno.env.get("NOTION_API_TOKEN");
53}
5455function generateRSSFeed(pages: any[], databaseMetadata: any): string {
56// Get database title from database metadata
57const databaseTitle = databaseMetadata.title[0]?.text.content
103}
104105function escapeXml(unsafe: string): string {
106return unsafe.replace(/[<>&'"]/g, function(c) {
107switch (c) {
108case "<":
bandcampWrappedScriptmain.tsx3 matches
14]
1516function esc(string) {
17return replacements.reduce(function(string, replacement) {
18return string.replace(replacement[0], replacement[1])
19}, string)
71)
7273function c(tag, style) {
74const elem = document.createElement(tag)
75if (style) elem.style = style
tweetArchiveViewermain.tsx10 matches
17const COBALT_API_URL = "https://dorsiblancoapicobalt.nulo.in";
1819async function fetchMedia(url) {
20try {
21const response = await fetch(COBALT_API_URL, {
58}
5960async function fetchTweets(dumpFile) {
61try {
62const response = await fetch(BASE_URL + dumpFile);
96}
9798function extractMediaUrls(tweet) {
99const mediaUrls = [];
100if (tweet.__raw_UNSTABLE && tweet.__raw_UNSTABLE.extended_entities && tweet.__raw_UNSTABLE.extended_entities.media) {
113}
114115function formatDate(dateString) {
116const date = new Date(dateString);
117return date.toLocaleString("es-AR", {
125}
126127function Tweet({ tweet, onMediaLoad }) {
128const formattedDate = formatDate(tweet.timeParsed);
129const [mediaContent, setMediaContent] = useState([]);
131132useEffect(() => {
133async function loadMedia() {
134const media = await Promise.all(tweet.mediaUrls.map(async (media) => {
135if (media.type === "video") {
188}
189190function App() {
191const [tweets, setTweets] = useState([]);
192const [filteredTweets, setFilteredTweets] = useState([]);
230}, [searchQuery, tweets]);
231232async function loadTweets() {
233if (isLoading) return;
234setIsLoading(true);
364}
365366function client() {
367createRoot(document.getElementById("root")).render(<App />);
368}
372}
373374export default async function server(request: Request): Promise<Response> {
375return new Response(
376`
heroicEmeraldWoodpeckermain.tsx2 matches
8.join(" OR ") + " " + excludes;
910function relevant(t: Tweet) {
11if (keywords.some(k => t.full_text?.includes(k))) return true;
12return t.entities.urls?.some(u => keywords.some(k => u.expanded_url?.includes(k)));
17const isProd = true;
1819export async function twitterAlert({ lastRunAt }: Interval) {
20// search
21const since = isProd
valreadmegeneratormain.tsx4 matches
4import React, { useRef, useState, useEffect } from "https://esm.sh/react@18.2.0";
56function App() {
7const [username, setUsername] = useState("");
8const [valName, setValName] = useState("");
158}
159160function client() {
161createRoot(document.getElementById("root")).render(<App />);
162}
163if (typeof document !== "undefined") { client(); }
164165export default async function server(request: Request): Promise<Response> {
166const url = new URL(request.url);
167const parts = url.pathname.split('/').filter(Boolean);
248});
249} catch (error) {
250console.error('Error in server function:', error);
251return new Response(`Error: ${error.message}`, { status: 500 });
252}
personalSocialCardGeneratormain.tsx5 matches
4import { createRoot } from "https://esm.sh/react-dom/client";
56function App() {
7const [cardData, setCardData] = useState(null);
841}
4243function PersonalCard({ data }) {
44return (
45<div className="bg-white rounded-xl shadow-2xl max-w-md w-full overflow-hidden">
115}
116117function getBackgroundColor(index) {
118const colors = ["bg-blue-100", "bg-green-100", "bg-purple-100", "bg-orange-100"];
119return colors[index % colors.length];
120}
121122function client() {
123createRoot(document.getElementById("root")).render(<App />);
124}
128}
129130async function server(request: Request): Promise<Response> {
131if (request.method === "POST" && new URL(request.url).pathname === "/generate") {
132const formData = await request.formData();
cerebras_codermain.tsx10 matches
15"recipe ingredient converter and scaler",
16"morse code translator with audio output",
17"random quote generator with tweet functionality",
18"personal finance tracker with basic charts",
19"multiplayer rock-paper-scissors game",
20];
2122function Dashboard() {
23const [stats, setStats] = useState<{
24totalGenerations: number;
3637useEffect(() => {
38async function fetchStats() {
39const response = await fetch("/dashboard-stats");
40const data = await response.json();
97}
9899function App() {
100const [prompt, setPrompt] = useState(
101STARTER_PROMPTS[Math.floor(Math.random() * STARTER_PROMPTS.length)],
128129useEffect(() => {
130async function fetchUsageStats() {
131const response = await fetch("/usage-stats");
132const data = await response.json();
136}, []);
137138async function handleSubmit(e: React.FormEvent) {
139e.preventDefault();
140setLoading(true);
170}
171172function handleVersionChange(direction: "back" | "forward") {
173const { currentVersionIndex, versions } = versionHistory;
174271}
272273function client() {
274const path = window.location.pathname;
275const root = createRoot(document.getElementById("root")!);
286}
287288function extractCodeFromFence(text: string): string {
289const htmlMatch = text.match(/```html\n([\s\S]*?)\n```/);
290return htmlMatch ? htmlMatch[1].trim() : text;
291}
292293export default async function server(req: Request): Promise<Response> {
294// Dynamic import for SQLite to avoid client-side import
295const { sqlite } = await import("https://esm.town/v/stevekrouse/sqlite");
blueskyAlertmain.tsx1 match
10});
1112async function search(q: string, lastRunAt: Date | undefined) {
13const res = await agent.app.bsky.feed.searchPosts({
14q,
3import { createRoot } from "https://esm.sh/react-dom@18.2.0/client";
45function generateRandomColor() {
6const hue = Math.floor(Math.random() * 360);
7return `hsl(${hue}, 70%, 50%)`;
8}
910function parseICSDate(dateString: string): Date {
11if (!dateString) return new Date();
1236}
3738function parseICSContent(content: string) {
39try {
40console.log("Parsing ICS content:", content);
75}
7677function Calendar() {
78const [events, setEvents] = useState([
79{
309}
310311function client() {
312createRoot(document.getElementById("root")).render(<Calendar />);
313}
315if (typeof document !== "undefined") { client(); }
316317export default async function server(request: Request): Promise<Response> {
318return new Response(`
319<html>