30 seconds of code
Short code snippets for all your development needs
Featured Collections
Latest Articles
Bash Shortcuts Cheat Sheet
Webdev, Article
Maximize your productivity when working with a bash or other shell terminal by using these keyboard shortcuts.
Write a useInterval hook in React
React, Article
Wrapping your mind around React hooks and how they interact with
setInterval()
can be difficult. Here's a guide to get you started.The benefits of writing
Career, Article
Writing about a topic can often sound boring or worthless. But there are significant benefits to doing it from time to time.
Top Snippets
kMeans
JavaScript, Algorithm
Groups the given data into
k
clusters, using the k-means clustering algorithm.getURLParameters
JavaScript, Browser
Creates an object containing the parameters of the current URL.
Horizontal scroll snap
CSS, Interactivity
Creates a horizontally scrollable container that will snap on elements when scrolling.
Mouse cursor gradient tracking
CSS, Visual
A hover effect where the gradient follows the mouse cursor.
luhnCheck
JavaScript, Math
Implementation of the Luhn Algorithm used to validate a variety of identification numbers, such as credit card numbers, IMEI numbers, National Provider Identifier numbers etc.