Skip to content

Instantly share code, notes, and snippets.

import React, { useMemo, useState, useEffect } from "react";
import { Download, Copy, Plus, Trash2, Target, BookOpen, Gauge, Settings, Upload, Timer, Ruler, Info } from "lucide-react";
// --- Utils ---
const clamp = (n, min, max) => Math.max(min, Math.min(max, n));
const pct = (n) => `${(+n).toFixed(n % 1 ? 1 : 0)}%`;
function readingTime(text) {
const words = (text.match(/\b\w+\b/gu) || []).length;
const minutes = Math.max(1, Math.round(words / 200));
import React, { useMemo, useState, useEffect } from "react";
import { Download, Copy, Plus, Trash2, Target, BookOpen, Gauge, Settings, Upload, Timer, Ruler, Info } from "lucide-react";
// --- Utils ---
const clamp = (n, min, max) => Math.max(min, Math.min(max, n));
const pct = (n) => `${(+n).toFixed(n % 1 ? 1 : 0)}%`;
function readingTime(text) {
const words = (text.match(/\b\w+\b/gu) || []).length;
const minutes = Math.max(1, Math.round(words / 200));