A recent post on Hacker News highlighted the benefits of detailed commit messages in git.
Usually, my git commits look something like this:
> git commit -m "fix: component missing configuration file"
…which isn’t all that helpful. (Related: see XKCD on git commit messages)
I decided to try and utilize this newfound knowledge in my own git commits and I quickly ran into an obstacle. Simply using
> git commit opens up vim. Which, I really don’t want to use. (I’m sorry!)
This is something I should already know how to do, but I had to do a Google search to learn more. It turns out, you can change the default editor in git. This makes it much more convenient! How do you do it?
git config --global core.editor "nano"
Replace “nano” with your preferred editor of choice. Now, running
> git commit opens up your editor and you can make detailed commit messages to your heart’s content!
I’ve been doing web development professionally for about 10 years now and just discovered something new. (I love it when this happens!)
These changes are saved to your local filesystem, allowing you to experiment with modifications without affecting the live website. This is especially useful for testing, debugging, and experimenting with different designs or functionalities.
Here’s how you can use local overrides in Chrome:
- Open Chrome Developer Tools:
– Right-click on any webpage and select “Inspect” or press `Ctrl+Shift+I` (Windows/Linux) or `Cmd+Opt+I` (Mac).
- Enable Local Overrides:
– Go to the “Sources” tab.
– In the navigation pane, click on the “Overrides” tab (you may need to click on the “>>” to see it).
– Click on “Select folder for overrides” and choose a folder on your local system. This is where your changes will be saved.
– Allow Chrome to access the folder if prompted.
- Start Editing:
– Find the file you want to edit in the page file navigator pane. You can navigate through the website’s file structure or find the file in the “Network” tab.
– Right click on a file and select “Override content”
– Once you open a file, you can modify it directly in the editor pane. Your changes will be reflected in real-time on the webpage.
- Save Changes:
– After editing, press `Ctrl+S` or `Cmd+S` to save your changes. These changes are saved to the selected local folder and will override the network resource until you disable overrides or delete the local file.
- Disable Overrides:
– To stop using local overrides, simply uncheck the “Enable Local Overrides” option in the Overrides tab.
Local overrides are a temporary way to experiment with web page modifications. They don’t affect the actual files on the web server, so other users won’t see these changes. This feature is highly useful for developers and designers to test changes without deploying them to a live server.
“Uh, what?” you say.
A few weeks ago, I read a post on Hacker News about something called “the coastline paradox.” Despite my geology background, I hadn’t heard of this before.
The measured length of the coastline depends on the method used to measure it and the degree of cartographic generalization. Since a landmass has features at all scales, from hundreds of kilometers in size to tiny fractions of a millimeter and below, there is no obvious size of the smallest feature that should be taken into consideration when measuring, and hence no single well-defined perimeter to the landmass.
Essentially, the smaller unit of measurement you use to try and measure something with a fractal pattern, the longer it becomes.
So, I’m currently reading a book called “Reading the Rocks” by Marcia Bjornerud and there is an entire section devoted to the coastline paradox, which I just learned about.
Mandelbrot’s point was simple: If you use a very long stick to measure a coastline, you will capture the broadest arcs but miss the fjords, firths, and coves, and you will conclude that the coastline is not terribly long. As you use shorter and shorter rulers, however, the coast actually stretches. Mandelbrot named such stretchy features fractals…
This brings up the second TIL: What is the phenomenon called when you hear something for the first time and then suddenly start seeing or hearing it everywhere?
It’s the Baader-Meinhof phenomenon, also known as the frequency illusion:
The frequency illusion (also known as the Baader-Meinhof phenomenon) is a cognitive bias in which a person notices a specific concept, word, or product more frequently after recently becoming aware of it.
Well, here’s to seeing more coastline paradoxes.
I believe Reddit pioneered the “TIL” meme (TIL, short for “Today I Learned…”).
Over on HackerNews, someone posted an interesting discussion related to a collection of “Today I Learned” notes on GitHub, featuring all sorts of interesting coding tidbits. It goes back over 8 years!
It’s such a brilliant idea and I think I’d like to adopt something similar myself: if I learned something new and interesting, I should post about it.