Slugify a string in PHP
Create URL-safe lowercase slugs from titles, removing accents and punctuation.
Loading snippets…
137 snippets
Create URL-safe lowercase slugs from titles, removing accents and punctuation.
Convert any title into a lowercase, hyphenated, accent-free slug that is safe to use in a URL.
Yield overlapping windows of fixed size, useful for moving averages and n-grams.
Pause an async function for a number of milliseconds, with optional cancellation through AbortSignal.
Publish and subscribe to named events in about 15 lines, with an unsubscribe function returned from on().
Create and verify a timestamped signature over the method, path and body so requests cannot be forged or replayed.
A horizontally scrolling gallery that snaps to each card, with no JavaScript.
Validate a config object against an interface while keeping its precise literal types.
Re-run flaky operations with growing delays and jitter, only for chosen exception types.
Re-run a flaky command a few times with increasing delays and a clear failure exit code.
Retry rate-limited requests after the delay the server asks for, instead of guessing.
Turn off or shorten animations for users who ask their system for less motion.