In a chance glance through the Git history of one of my projects last week, I found commit
53331294. A hash with eight leading numbers! A sequence like this isn’t particularly rare, but it’s also not an everyday occurence.
Today at work, I notice the palindrome
39eee93 while using
git reset1. SHA-1 works in mysterious ways. 🤔
Of course, there are plenty of other pretty commits out in the wild. You can always try brute-forcing a commit with more leading zeroes than
00000000000000, or cracking a joke with
If you’re musically inclined, what melodies use the natural notes bar G? The lick is unfortunately not SHA-friendly.
When you commit next, consider a pause to admire the hash. Who knows what pattern you might spot?
1 If you find yourself navigating the fog that is
git rebase, remember to throw out a tag here and there. It’s a great catch if (like me) you occasionally need to reset. 😅
Recently, Cloudflare made their Tunnel service (formerly Argo Tunnel) free and available for all Cloudflare users. For an existing free-tier user like myself, there’s no better time to try it out!
Tunnels are designed for securely connecting an origin server to a web-facing endpoint. They’re particularly great if
- You’re a service operating from a network/zone that doesn’t allow inbound connections
- You’re a developer looking to expose your local server to the web
There are generic tools out there that fill this niche (ngrok is great for quick demos, and there’s inlets if you prefer self-hosting), but Cloudflare’s offering works well for me because I already use them to manage my website.
Down to business - I’ll be using my website for this example because it’s built with Hugo.
After installing the
cloudflared tunnel client, there’s a few commands to authenticate and create a tunnel. I’m calling my tunnel
preview, and exposing it at
cloudflared tunnel login
cloudflared tunnel create preview
cloudflared tunnel route dns preview tunnel.nicholas.cloud
With a tunnel created, we can start tunnelling traffic from port
1313, the default port for Hugo’s dev server.
cloudflared tunnel run --url localhost:1313 preview
https://tunnel.nicholas.cloud/ now will show a
502 Bad gateway error, since our Hugo server isn’t running yet. Let’s start it up!
hugo server \
There’s a few options we specify with this development server, seeing as we’re no longer serving traffic from
- Overriding the default URL to your chosen URL with
appendPort, since the tunnel’s exit responds to traffic on the default HTTPS port
- Likewise, the
liveReloadPort should be
443 so pages will be reloaded as we make changes
There you have it, a live preview of your Hugo site on your own domain thanks to Cloudflare Tunnel!
Thanks to Hugo (not the site generator!) for his bit on previewing Hugo sites in GitHub Codespaces, which inspired me to try this out!
With a little bit of invested time, I’ve figured out a nice little process for previewing changes to my site. The technical side of it is a writeup for another day, but it’s too cool to not to talk about here and now.
I start with my local changes on a new branch, pushing it to GitHub. The response includes a link to create a new pull request.
git push -u origin HEAD
# remote: Create a pull request for 'disable-analytics-in-preview' on GitHub by visiting:
# remote: https://github.com/nchlswhttkr/website/pull/new/disable-analytics-in-preview
# To github.com:nchlswhttkr/website.git
# * [new branch] HEAD -> disable-analytics-in-preview
# Branch 'disable-analytics-in-preview' set up to track remote branch 'disable-analytics-in-preview' from 'origin'.
The commit message determines the pull request’s title. Referencing an open issue in the PR’s description makes the two pages reference each other.
PR opened. A workflow I’ve made with GitHub Actions kicks off, and my changes are deployed to a preview domain. A link to the deployment is included with the pull request.
PR merged. The same workflow kicks off and cleans up the deployed preview, marking it as inactive. The merged branch is deleted. Since the description a reference to “close #41”, the corresponding issue is also closed. 1
It’s kinda amazing how much of a breeze previewing is for me now, only ever a pull request away. GitHub’s developer experience really shines here too.
1 Fun fact: GitHub doesn’t like it when you close 100 issues at once with a single pull request.
A new approach to online tracking being trialed by Google has been under scrutiny this week, from developers and privacy advocates alike.
Along with others, I’m explicitly opting-out my website out of this program. Thankfully it’s a one-liner in my Nginx config.
+ add_header "Permissions-Policy" "interest-cohort=()";
According to Google, this tracking method is activated (for the time being) when sites do either of the following.
- Load ads or ad-related resources (whatever Google determines this to be)
With that said, there’s no saying when or how this will change. Taking the hardline approach to avoid this behaviour seems sensible to me.
I’ve got more to say on the stances companies like Google take on privacy, but that’s a longer piece of writing for another day.
Thanks to Ruben Schade for his bit on FLoC too!
I stumbled across an old animation from a few years ago yesterday, set to a rather funky beat. Not the most fascinating thing on its own. Interesting though, how my perspective has changed a bit after looking into the music a little bit more.
By itself, the song is great. There’s more lurking beneath the surface though.
It uses the vocals from Fire Fly by Childish Gambino.
The vocals are mashed up with the instrumental from MF DOOM’s Coffin Nails.
DOOM uses a sample from Dave Matthews' guitar solo in Space Oddity.
Travere the tree, and you’re listening to a mashup with a sample from a cover of a David Bowie song!
Isn’t it funny how deep the roots of a song can reach?