Quick-Tip

Sep 25, 2019

Remove a commit from history in Git – local and remote

I recently committed an API key to a repository and even worse, I pushed to GitHub before I realized my mistake… 🙁 Removing the key from the code base wouldn’t completely solve my problem since a commit diff would still display my secret key. The solution was to remove that commit from history.

Nov 30, 2018

Map a string in Python with enumerate

Problem: create a map of the letters and indices in a string. My first approach was to loop over the string using range(len(s)), and checking if the letter exists in the map before adding it: