Create your own query selector shorthand in vanilla JavaScript
Ever wanted to create your own jquery-like query selector shorthand? Here's how!
Finding ways to improve and optimize your code takes a lot of time, research and energy. Level up your coding skills one step at a time with this collection of quick tips and tricks.
Ever wanted to create your own jquery-like query selector shorthand? Here's how!
Learn how to generate a random hexadecimal color code with a few lines of JavaScript.
Learn how to swap the values of two variables in JavaScript using a single line of ES6 code.
Learn two ways to format a string in Python with this quick tip.
Learn how to make your CSS transitions feel perfect when users interact with elements on the page with this simple tip.
You might have heard that line-height
should be unitless, but do you know why?
Calculate the date of n
days ago from today or the date of n
days from now.
Calculate the coordinates of the current scroll position in the browser window using JavaScript.
Learn how to easily convert any string to a URL-friendly slug, using regular expressions.
Implement responsive typography with the CSS clamp() function.
You can use a CSS pseudo-class selector to style all links in a page, without worrying if they have been visited or not.
Discover how to improve your website's performance by implementing lazy loading for images using a native HTML attribute.
Easily convert between a JavaScript Date object and a Unix timestamp.
Implement Python's divmod()
built-in function in one line of JavaScript.
Here's a quick and easy way to select the currently focused DOM element in JavaScript.
Learn how to eliminate the annoyance of copying dollar signs ($) along with terminal commands from the web with a simple bash alias.
Nesting elements with rounded borders can look very wrong if not done correctly. Here's a quick tip on how to do it right.
Effortlessly create upstream branches on push by enabling a simple git config setting.
Learn how to retrieve the first or last n
elements in a JavaScript array with a single line of code.
Messing up the order of chained then
and catch
methods in JavaScript promises can cause problems. Here's a short primer on the subject.
Ever needed to create a git commit with a different date? Here's a quick and easy way to do it.
Resource prefetching is a great way to improve perceived page speed on your website and requires little effort. Learn how to use it today.
Figure out the exact number of bytes in a JavaScript string, including Unicode characters.
Numeric separators are a somewhat lesser-known JavaScript syntactic sugar that can make working with large constants a lot easier.