gmb.dev -> blog

Notes to Self: git filter-repo

gmb published on
2 min, 257 words

An image of a complex highway intersection in Dubai Photo by Nick Fewings on Unsplash

This is one of those writing-it-down-so-I-know-where-it-is blog posts.

git filter-repo is an incredibly useful utility for doing various things to git repositories. It’s been particularly handy for me when merging repos together - or splitting them apart.

Here’s how to handle those two cases.

Read More

That Documentation Thing

gmb published on
10 min, 1918 words

An image of papers on bookshelves
Photo by Maarten van den Heuvel on Unsplash

Documentation. It’s one of the most important — and most neglected — parts of a developer’s day-to-day job. How we write documentation shapes the way we think, the way we build a product, and the way that product is handed on to the next engineer who has to maintain it (who may or may not be a future version of ourselves).

As with everything, I’ve formed some opinions about it. Read on if you’re interested.

Read More

Nothing but a Number

gmb published on
2 min, 323 words

A grey bearded man using an angle grinder to cut metal. Sparks fly from the grinding wheel Photo by guven karakoc on Unsplash

From Hacker News

“I’m 51 and I’ve been active in this industry since I was 14. I watched it grow from computers with 4k of memory to having a supercomputer in my pocket. I was learning in the age of Apple II and the Commodore PET. When I realized that I could create an explosion of data with just a few lines of code, I was hooked forever. It was such a magical thing. I found some other guys in my high school that were also into computers and we started meeting regularly on Fridays and Saturdays to… Well, to do some things that were, perhaps, not allowed. Since then, I’ve started three companies, and I don’t think I could have found the same satisfaction in any other industry. I am mindful, these days, that I’m 51 because I know ageism is a thing in tech. There’s a moment when you walk into a room and people think, ‘Oh, he’s a greybeard.’ I don’t have a beard, but you know what I mean. But when I start to talk about things and find solutions, that disappears. I can’t change my age but I am in full control over what I do and what I read and how much time I carve out to write code. I can still see myself doing this when I’m 60, 70 years old. Even older. Because I want to keep doing meaningful things.”

That’s heartwarming to read. I’ll confess that this is something on my mind, now that I’m nearly six months into my 42 orbit around the sun.

Read More

The Ready-to-Code Checklist

gmb published on
2 min, 272 words

Concrete blocks in the form of descending stairs Photo by Ricardo Gomez Angel on Unsplash

This is a repost of a very old Tumblr post (remember Tumblr…?) for the sake of mine and others’ reference.

Original Post

I’m currently working on a Thing for a Client, and I’m reminded of the rules that we used to have for doing Launchpad development. One of them was the Ready-to-Code checklist. Googling “Ready to Code” brought this up as the third result, and since it’s still relevant to me, I thought I’d repost it for general consumption.

s/Launchpad/$YOUR_PROJECT/ as appropriate.

Read More

Notes to Self: Mongo Aggregate Pipeline Sorting Redux

A better solution to the lack of NULL LAST sorting in Mongo.

gmb published on
3 min, 533 words

Another pipe, because I can’t think of a better image… Photo by Martin Adams on Unsplash

In my previous post on this subject I described a way to use multiple Mongo queries, followed by Python’s itertools.chain() to do NULL LAST sorting in Mongo (which isn’t a thing that exists as a feature of the DB).

However, I knew that this wasn’t an optimum solution. Partly because it’s doing multiple queries, but mostly because it means that doing things like pagination are really complicated thereafter.

… but there is a better way.

Read More