week 42, 2020

First Page on Hacker News

Yesterday I managed to get on the first page of Hacker News with a link to tumblelog on GitHub: Show HN: Static blog generator in about 1 KLOC. In the past I had submitted tumblelog more than once but didn't get much upvotes, sometimes none at all. But the magic word KLOC (kilo lines of code) and maybe the submission time did the trick.

Position 17 on Hacker News

I did manage to get on position 17 on the front page. At least that's what I know. So what has been the effect of this? At the time of writing according to GitHub:

  • 1,755 Unique visitors.
  • Three clones.
  • Number of stars went from 49 to 68.

The number of visitors I have is normally a few a day, so the effect was very significant on the number of visitors. I am very happy with the increase in the number of stars, thanks everyone who voted!

I hope that this will result in people using tumblelog for their blog. And hopefully also some feedback.

The Emacs Problem

Charles G. pointed out in an email discussion recently:

Lisp still doesn't seem like the right language for doing text manipulation, and nothing I've seen from the Emacs libraries is making me think any differently. It sure beats the hell out of Java though. Maybe someday someone will write Emacs using Ruby as the embedded interpreter...

These are all great points. I know exactly how he feels. I know soooo exactly how Charles feels that I decided to write a blog instead of an email reply. Because all the things he's brought up are real, bona-fide problems.

Source: The Emacs Problem, an article by Steve Yegge.

No, The iPad Pro is not a development machine

iPads, which is to say any iPad made in the last three years (yes, even the base models) has more than enough power to run development tools and compile most codebases you would care to. The more recent iPad Pro models even give modern Core i9 laptops a run for their money in some metrics.

Why then do we not see development tools on the iPad? Or at least, why do we not see more of the development tools we’re used to seeing on the platform. The reason, unfortunately, is iPadOS.

Source: No, The iPad Pro is not a development machine. But it so easily could be, an article by Jay Rodgers.

Self-hosting Git

cgit is very bare bones. It is cgi web interface interface to git, and nothing more. You may browse repositories, view diffs, commit logs and even clone via http. If you are looking to replace Github with cgit, keep in mind that cgit does not handle issues or pull/merge requests. If people wish to contribute to your work, they would have to send you a patch via email.

Source: Self-hosting Git, an article by Akshay Oppiliappan.

Tumblelog 4.1.0

In the evening I finally released an updated version of tumblelog; a static blog generator that comes in two versions: a version written in Perl and a version written in Python. I use mostly the Perl version to generate Plurrrr but now and then run the Python version to verify it generates the same output given the same input.

This version fixes a bug I found using Ahrefs Webmaster Tools. I also used pylint version 2.6.1-dev1 to improve the Python code. The score went from 8.57 to 8.85. Some of the issues found where also in the Perl code, so I corrected the Perl version as well.

Next I used perlcritic version 1.138 to critique the Perl version of tumblelog. Several of the issues found were fixed.

Last, but not least, I factored out the font stacks of all styles into a separate _fonts.scss file and used stylelint version 13.7.2 with a custom .stylelintrc.json to clean up the styles for tumblelog.

Version 4.1.0 of tumblelog is available on GitHub. As always feedback is very welcome.

Mambo Sun

In the early afternoon I listened to a new track by Pixies; a cover version of T. Rex's Mambo Sun. While it's a catchy tune I do miss the days of Surfer Rosa/Come On Pilgrim and Doolittle.

iOS and iPadOS 14: The MacStories Review

The context of 2020 is what makes iOS and iPadOS 14 so fascinating and, to a certain extent, fun to review. On one hand, we have two major OS updates that may or may not have been impacted by the global pandemic in their focus on fewer groundbreaking additions and more consistent improvements across built-in apps; on the other, just like any other year, we have a suite of overarching themes and potential implications to dissect.

But for all those users still pausing over that ‘Install’ button, pondering whether updating their most important communication and work-from-home devices is worth it, there’s only one consideration that matters:

Will this go any better than last year?

Source: iOS and iPadOS 14: The MacStories Review, an article by Federico Viticci.

Chromatopelma cyaneopubescens eating

Early in the evening I gave the Chromatopelma cyaneopubescens, common name "Green Bottle Blue" (GBB for short), that I keep a mealworm.

Chromatopelma cyaneopubescens eating a mealworm
Chromatopelma cyaneopubescens eating a mealworm.

Dockerfile Security Best Practices

Container security is a broad problem space and there are many low hanging fruits one can harvest to mitigate risks. A good starting point is to follow some rules when writing Dockerfiles.

I’ve compiled a list of common security issues and how to avoid them. For every issue I’ve also written an Open Policy Agent (OPA) rule ready to be used to statically analyze your Dockerfiles with conftest. You can’t shift more left than this!

Source: Dockerfile Security Best Practices, an article by Gianluca Brindisi.

Prefer Fakes Over Mocks

When writing tests, I prefer to avoid mocks as much as possible and rely on fake implementations instead. They require a bit of additional upfront investment, but provide many practical advantages which are important to consider.

In this article we will look at the differences between these two variants of test doubles, identify how using one over the other impacts test design, and why using fakes often results in more manageable test suites.

Source: Prefer Fakes Over Mocks, an article by Alexey Golub.

A few words on Git

Git is not a success story. Git is a failure as a system with a crap user experience that forces you to learn more about the tool you're using that about getting your work done.

Source: A few words on Git, an article by Hadi Hariri.

CSS Layout - Grid vs Flexbox

Programming languages make websites feel alive, but at the core of every web page stands the good old HTML. When we discuss layouts, we must consider factors that make a good layout: responsiveness, viewing ports, display devices, browsers, and users’ screen sizes. A great layout not only looks great but can preserve the original intent by fitting in every possible display ratio. This correction is produced through CSS. In this article, we will examine two powerful properties: CSS Flexbox and CSS Grid.

Source: CSS Layout - Grid vs Flexbox, an article by Ivaylo Ivanov.

What is Functional Inheritance?

Functional inheritance is the process of inheriting features by applying an augmenting function to an object instance. The function supplies a closure scope which you can use to keep some data private. The augmenting function uses dynamic object extension to extend the object instance with new properties and methods.

Functional mixins are composable factory functions that add properties and behaviors to objects like stations in an assembly line.

Source: What is Functional Inheritance?.

How I Tried To Reduce Pylint Memory Usage

Through work I have to deal with a pretty huge codebase, and run Pylint on it during our continuous integration process. It's always been a bit slow, but recently I also noticed that it was consuming a lot of memory, causing OOM failures if we tried to run it too much in parallel.

I decided to roll up my sleeves and figure out:

  • What exactly was consuming so much memory?
  • Is there a way to avoid doing this?

This is a log of how I went about these two questions, as future reference for when I do other profiling work in Python.

Source: How I Tried To Reduce Pylint Memory Usage, an article by Raphael Gaschignard.

Hacking together a USB-C charger for a cheap Chromebook

The era of USB-C has come. The other day I threw all other cables into a box, and bought a set of USB-C to USB-C, Lightning, and microUSB cables. USB-C chargers around the house, USB-C PD power bank, even a nice small USB-C dock that works with the Nintendo Switch if the charger can do the right voltage. It's glorious.

Only one thing won't charge with USB-C, my awfully cheap ($190 for 4GB of RAM) Samsung Chromebook 3, a machine I use when I want the extra security of the Chrome OS platform. Instead, this laptop charges from an old-school 12V barrel connector, forcing me to carry around an extra brick. 😢

Source: Hacking together a USB-C charger for a cheap Chromebook, an article by Filippo Valsorda.

Git Secrets: 7 Commands You Might Not Know

Over the last couple years, Git has become a default part of almost every developer's knowledge stack. But even though Git is so well-known, there are many Git commands that are not.

In this short post, I'd like to show you seven little commands that can help you become more productive and well-versed with Git. Let's dive in.

Source: Git Secrets: 7 Commands You Might Not Know, an article by Tobias Günther.