Snippets
-
22 Nov 2022
A responsive striped CSS gradient inspired by 80s VHS tapes
Create a responsive, horizontal-striped CSS gradient inspired by 80s VHS tapes using CSS custom properties and a linear gradient.
-
5 Sep 2022
Rewrite your git history in 4 friendly commands
Did you make a series of unfortunate commits? Learn how to rewrite the git history of a repository in 4 friendly terminal commands to clean up your nonsense.
-
29 May 2022
Level up your link previews in Slack
Add extra metadata to the head tag in your web pages — such as reading time and author — to show richer previews in Slack when your link is unfurled.
-
11 May 2022
Light and dark mode in just 14 lines of CSS
Want to add quick support for light mode and dark mode to your website using only CSS? Combine two CSS custom properties with a media query to get set up in seconds.
-
21 Mar 2022
How to format dates for RSS feeds (RFC-822)
The RSS feed lives on! But I've always found it difficult to Google for the correct date format required for RSS feeds (RFC-822). Here's a selection of links, guidance and code snippets for future me — and you!
-
7 Mar 2022
How to delete all merged git branches with one terminal command
Automate your git cleanup! Here's a shell function to add to your bashrc/zshrc file to delete all merged git branches in one command.
-
11 Feb 2022
How to build an HTML-only accordion — no JavaScript required!
You don't need JavaScript to build accordions! Here's how to harness the power of native HTML and build an accordion with just four lines of code.
-
11 Jul 2021
How to avoid using relative path imports in Next.js
Say goodbye to ../../../../really/long/and/silly/paths/to/components in your Next.js application and define absolute imports with a jsconfig.json file.
-
8 Jul 2021
How I set up my new Next.js projects with a handy bash script
After I create a new Next.js application with npx create-next-app, I run this bash script to prepare my app for development — just the way I like it. And then I tell myself to have a nice day! Give it a try!