Articles by Jarosław Wierzbicki

Conditional content removal using Docutils classes

Jarosław Wierzbicki, on Mon 07 June 2021

Some time ago I had a problem where I had to exclude parts of one of my documents based on a build-time condition. I wanted to maintain one document but produce two versions: one that contained internal details of a product and one that didn't.

Nowadays I use reStructuredText (reST) and Docutils for writing my documents so naturally, I started Googling how to do it with the help of those tools. After some research, I found an out-of-the-box solution (unsurprisingly because we all have similar problems 😉). It may surprise you if you haven't looked into this problem before.

Connecting to Android device from Windows Subsystem for Linux using ADB

Jarosław Wierzbicki, on Tue 01 June 2021

A few weeks ago COVID-19 finally hit Taiwan (so far we've been doing pretty well) and I had to move to work from home like the rest of the world (well at least some of it). This forced me to use my work laptop for more than meetings.

Normally I use a Linux PC for daily work so to get at least some of the comfort back I've set up Windows Subsystem for Linux version 2 (WSL2) on the laptop.

This didn't go without a few bumps along the way. The biggest one was the fact that WSL2 doesn't support accessing USB devices (version 1 allegedly does [1] but I didn't have a chance to check) from Linux. And this was a problem for me since I need to connect to an Android device frequently.

But as long as there's Internet there's hope. After digging for some time I wasn't disappointed because it turned out that there is a solution to this problem.

Serving compressed files from Google Cloud Storage

Jarosław Wierzbicki, on Tue 14 January 2020

Recently I’ve been looking into some ways to optimise the loading speed of a website that I’m working on. One of the possible improvements suggested by Chromium’s Audit tool was to enable text compression. An obvious thing to do, one might say, but the question is not whether to do it at all but rather how to do it.

Let’s start from the beginning though. The idea is simple. Instead of serving plain text files like CSS and JavaScript to the browser, those files should be sent compressed so that the browser, upon receiving them, can decompress them to a plain text format. There is, of course, a CPU time cost to this approach but in most cases the savings from the data transfer outweigh it by a large margin [1]. This is particularly true for mobile devices where the bandwidth is often limited.

Many servers nowadays support compression (be that dynamic or static) and there are plenty of resources describing how to enable it but for some reason I couldn’t quickly find information on how exactly to do it for Google Cloud Storage.