3const uuid = "1fd98a05-4959-42bc4-2f83-2c487c1cde6d";
4const build = `https://${uuid}.cloudflarepreviews.com/?url=`;
5export async function cfetch(input: string | URL, requestInit?: RequestInit) {
6return fetch(`${build}${encodeURIComponent(input.toString())}`, {
7...requestInit,
Storyweavermain.tsx7 matches
3import { createRoot } from "https://esm.sh/react-dom/client";
45function LoadingSpinner() {
6return (
7<div className="loading-spinner">
12}
1314function cleanText(text: string) {
15return text
16.replace(/\*+/g, '')
19}
2021function App() {
22const [storyParts, setStoryParts] = useState({
23title: null,
133}
134135function client() {
136createRoot(document.getElementById("root")).render(<App />);
137}
138if (typeof document !== "undefined") { client(); }
139140// Utility function to implement timeout
141async function withTimeout<T>(promise: Promise<T>, timeoutMs: number): Promise<T> {
142let timeoutHandle: number;
143const timeoutPromise = new Promise<never>((_, reject) => {
152}
153154export default async function server(request: Request): Promise<Response> {
155if (request.method === 'POST' && new URL(request.url).pathname === '/generate-story') {
156const formData = await request.formData();
blob_adminmain.tsx8 matches
13}
1415function Tooltip({ children, content }: TooltipProps) {
16const [isVisible, setIsVisible] = useState(false);
17const tooltipRef = useRef<HTMLDivElement>(null);
52}
5354function formatBytes(bytes, decimals = 2) {
55if (bytes === 0) return "0 Bytes";
56const k = 1024;
61}
6263function copyToClipboard(text) {
64navigator.clipboard.writeText(text).then(() => {
65console.log("Text copied to clipboard");
69}
7071function ActionMenu({ blob, onDownload, onRename, onDelete, onMoveToPublic, onMoveOutOfPublic }) {
72const [isOpen, setIsOpen] = useState(false);
73const menuRef = useRef(null);
7677useEffect(() => {
78function handleClickOutside(event) {
79if (menuRef.current && !menuRef.current.contains(event.target)) {
80event.stopPropagation();
158}
159160function BlobItem({ blob, onSelect, isSelected, onDownload, onRename, onDelete, onMoveToPublic, onMoveOutOfPublic }) {
161const [isLoading, setIsLoading] = useState(false);
162const decodedKey = decodeURIComponent(blob.key);
219}
220221function App({ initialEmail, initialProfile }) {
222const encodeKey = (key: string) => encodeURIComponent(key);
223const decodeKey = (key: string) => decodeURIComponent(key);
645}
646647function client() {
648const initialEmail = document.getElementById("root").getAttribute("data-email");
649const initialProfile = JSON.parse(document.getElementById("root").getAttribute("data-profile"));
MathFlashCard_RetroEditionmain.tsx5 matches
4import confetti from "https://esm.sh/canvas-confetti";
56function generateProblem(config) {
7const operations = [];
8if (config.addition) operations.push('+');
54}
5556function MathFlashcards() {
57const MAX_STREAK = 5; // Number of segments in streak bar
58const SUPER_STREAK_THRESHOLD = 5; // Threshold for special animations
383}
384385function App() {
386return React.createElement("div", { className: "app" }, React.createElement(MathFlashcards, null));
387}
388389function client() {
390createRoot(document.getElementById("root")).render(React.createElement(App, null));
391}
392if (typeof document !== "undefined") { client(); }
393394export default async function server(request: Request): Promise<Response> {
395return new Response(
396`
katakanaWordApimain.tsx1 match
1import { OpenAI } from "https://esm.town/v/std/openai";
23export default async function(request: Request): Promise<Response> {
4try {
5const openai = new OpenAI();
3132// ------------
33// Functions
34// ------------
3536async function execute(statement: InStatement, args?: InArgs): Promise<ResultSet> {
37const res = await fetch(`${API_URL}/v1/sqlite/execute`, {
38method: "POST",
49}
5051async function batch(statements: InStatement[], mode?: TransactionMode): Promise<ResultSet[]> {
52const res = await fetch(`${API_URL}/v1/sqlite/batch`, {
53method: "POST",
64}
6566function createResError(body: string) {
67try {
68const e = zLibsqlError.parse(JSON.parse(body));
85}
8687function normalizeStatement(statement: InStatement, args?: InArgs) {
88if (Array.isArray(statement)) {
89// for the case of an array of arrays
107}
108109function upgradeResultSet(results: ImpoverishedResultSet): ResultSet {
110return {
111...results,
116// adapted from
117// https://github.com/tursodatabase/libsql-client-ts/blob/17dd996b840c950dd22b871adfe4ba0eb4a5ead3/packages/libsql-client/src/sqlite3.ts#L314C1-L337C2
118function rowFromSql(
119sqlRow: Array<unknown>,
120columns: Array<string>,
decisiveRoseFelidaemain.tsx5 matches
3import { createRoot } from "https://esm.sh/react-dom/client";
45function WeatherDashboard() {
6const [theme, setTheme] = useState('light');
7const [weather, setWeather] = useState(null);
1516useEffect(() => {
17async function fetchWeather() {
18try {
19const response = await fetch(
157}
158159function client() {
160createRoot(document.getElementById("root")).render(<WeatherDashboard />);
161}
163if (typeof document !== "undefined") { client(); }
164165export default async function server(request: Request): Promise<Response> {
166return new Response(`
167<html>
182}
183184function generateCSS(theme: 'light' | 'dark') {
185return `
186:root {
Snake_gamemain.tsx4 matches
8const INITIAL_FOOD = { x: 15, y: 15 };
910// Helper function to check if two directions are opposite
11const isOppositeDirection = (dir1, dir2) => {
12const oppositeMap = {
19};
2021function SnakeGame() {
22const [snake, setSnake] = useState(INITIAL_SNAKE);
23const [food, setFood] = useState(INITIAL_FOOD);
211}
212213function client() {
214createRoot(document.getElementById("root")).render(<SnakeGame />);
215}
216if (typeof document !== "undefined") { client(); }
217218export default async function server(request: Request): Promise<Response> {
219return new Response(`
220<html>
switchExtractormain.tsx2 matches
12const dataChart: { variable: string; value: number }[][] = [];
1314function getValueOf(text: string): number {
15const pattern = new RegExp(`,${text}=0x([a-zA-Z0-9]+)`, "g");
16const match = pattern.exec(str);
40}
41};
42export function solve(p: Array<any> | string) {
43if (Array.isArray(p)) {
44return p;
scraper_templateREADME.md1 match
133. Adjust the if statement to detect changes and update your blob
14154. Craft a message to be sent with `sendNotification()` function