Easy find and replace is one of those quality of life improvements that make Vim great. With one quick command, and a little regex, you can replace a pattern across an entire file. Here’s how: Find and replace in the entire file with Vim:%s This is my most-used version of Vim find and replace. :%s […]
Tips
Regex Cheatsheet
Regex is very powerful and available in virtually every language. Eventually I’ll write a whole post about why every engineer should know some Regex, but this post is all about common regex patterns, flags, etc—in easy-to-read table form. First, here are some patterns similar to ones I’ve used in recent memory: Pattern Meaning Example Match […]
Git tips and tricks
Git is an essential development tool, and an endless stream of things to learn. This post is some of the tips, tricks, and configurations I use to make life easier day-to-day. Here’s what’s below: Disclaimer: I’m not a git expert. These are just things that have come in handy in my years as a heavy […]
Developer workflow tips no one tells you about
As developers, we’re expected to know a lot of random things. Sure, you can learn data structures and algorithms from a CS class, and you can learn frameworks from online tutorials or a bootcamp, but what about the other things? How to be more effective on the command line? How to increase productivity on your […]
Dedupe a list in Vim
Tldr: use :sort u Surprisingly often, I find myself needing to dedupe a list, usually when digging through logs. There are many ways to dedupe a list, but Vim might just be the fastest one. Take this list of UUIDs I pulled when investigating a recent issue: From a quick look, I can see that […]
Save your shell history to log files
Every command I enter on my computer is written to a log file. These logs have come in handy countless times; I tell anyone who will listen to save their logs too. My inspiration for doing this came from this atomic object post many years ago, and I am so glad I followed their advice. […]
Git log customization
The git log command outputs a lot of useful information—message, author, date, hash, branch—but its default format leaves something to be desired. Mostly, it just takes up too much screen space. Here’s an example, using the popular Python package flask: The default git log above has all the information we want, but just two commits […]
Copy and paste from the command line
We use copy and paste all the time, so why not use them from the command line? I do it all the time, so let’s do a quick run down. First, the commands: Copy something from the web and paste it to a file This is my most frequent usage of either of these commands, […]
Git commit and commit message best practices
I’ve seen lots of advice about git commits and messages over the years—some good, some not so good. This post will go through what works for me. Note: I’m no git workflow expert, these are just my personal opinions developed over ~10 years working at startups. Commit Best Practices: Commit Message Best Practices: Let’s go […]
How to free up disk space
Part of being a developer means constantly downloading new packages, updates, codebases, etc. Eventually, your computer starts to fill up. This post details how to clean it out. The du command This is the disk usage command, and it is key to figuring out what is using your space. Here’s my usual workflow: Starting at […]