I tried searching for a nice listing of all the built-in Vim :colorscheme (or :colo for short) options and I couldn’t find one, so here it is. This post is every :colo option that comes with Vim and a screenshot of what it looks like with some nonsense python code.
Reverse a string in Python
The simplest way is to use Python double colon slicing with a negative step value: You can also use the builtin reversed method, which will “Return a reverse iterator over the values of the given sequence” according to its official help(). Note that this returns an iterator, not a string, so you’ll have to do […]
Meeting Cost Calculator
How much do your meetings really cost? Find out here.
Vim find and replace
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 […]
What makes an effective development team
After a decade as an engineer at companies ranging in size from 6 people to over 1000, I’ve been on many teams. The good teams were very similar, the bad ones were each bad in their own way. This post describes what made the good teams good.
Check if key exists in Javascript object
To check if a key exists in a js object, you can: compare the key’s value to undefined, use .hasOwnProperty, or use “key in object” syntax. Each method behaves a bit differently, so let’s do some examples.
Replace a string in Python
To replace a string or substring in Python you have two main options: Python’s String Replace Method The string.replace method works roughly how you would expect it to: By default, string.replace will replace all occurrences of the string you want to replace. However, it accepts an optional integer third argument specifying how many times to […]
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 […]
Copy an object in Javascript
There are several ways to copy an object in Javascript, and they fall into two categories: shallow copies and deep copies. Before going deeper, it might be helpful to define the two: If you’re copying a simple Javascript object with top-level properties only, all copies will be deep copies, regardless of what method you use. […]
Undo a Git Commit
To undo a git commit, you have a couple of options: git revert and git reset. You can also amend prior commits.