Tags
Browse snippets grouped by topic.
#utils
One-line UUID v4
Anonymous·8h ago
// Generate an RFC 4122 v4 UUID using the Web Crypto API
const uuid = () =>
([1e7] + -1e3 + -4e3 + -8e3 + -1e11).replace(/[018]/g, (c) =>
(6600
Tailwind cn() class merger
@maya_dev·3d ago
import { clsx, type ClassValue } from 'clsx'
import { twMerge } from 'tailwind-merge'
// Merge conditional class names and resolve Tailwind conflicts.12800
Python retry decorator
Anonymous·4d ago
import time
from functools import wraps
def retry(times=3, delay=0.5):9900