When working on web projects it is often useful and recommended to enable SSL for your development environment. For example if your project works with cookies, it is likely that the server sets the Secure attribute, ensuring that they only sent to the server over HTTPS. But even without cookies it's a good idea to try to minimize differences between your development and production environments. Fortunately, using Docker that can be done done easily in just a few steps.

Generate locally trusted certificates

mkcert is a command line tool that makes it ridiculously simple to generate locally trusted certificates, for development.

  1. Install mkcert, as documented in the readme. In my case, running Windows, it's just a choco install mkcert
  2. Generate and install the CA (Certificate Authority): mkcert -install
  3. Create a new certificate for the project: mkcert elborai.me localhost
  4. And that's it, just rename the key and certificate to something that makes sense

Reverse proxy


Read full post

When I start to use a programming language I always have the following questions:

  • How do I build/run my program?
  • How do I run tests?
  • How do I install dependencies?
  • How do I integrate all of this in my text editor?

Some languages such as Go come with simple answers to these questions: go build ./..., go test ./..., go get <my module>, install the official Go extension for your editor. Done. But of course in the case of C++, things are ... different 🙃.

The C++ world is way more fragmented, there is a lot of choices of build and meta build tools, various test frameworks (each with its own test runner), lot of way to manage dependencies, etc. Because so much choices can be daunting for people who just want to start with the language, and because I know I will forget how things work, in this article I will document what I've done to get to a fully working environment that answers all my questions in a simple and coherent way. At the end of this guide we will be able to build and run tests in just one click (or command line if that's your thing).

Tools popularity can vary quite a lot from years to years, for example solutions to manage dependencies are still competing against each other and new ones are popping all the time, so I want to be clear that this document is my setup in 2020, hopefully it will stay evergreen in the future, but I wouldn't bet too much on it.

Read full post

Hide scores on HackerNews

A few days ago I re-published on the Chrome Web Store a small browser extension "HackerNews No Pressure". You can find the store listing here.

It's purpose is to hide user scores, comment scores, and link scores when browsing https://news.ycombinator.com. The implementation is ridiculously simple, it doesn't have any logic, and only consists in a small stylesheet that hides a few elements. It doesn't have any impact other than this and is fairly stable, I'm using it as a side-loaded extension since around 5 years now with zero maintenance.

Someone asked about that feature in a recent thread, so I felt that would be nice to make it available again to more people.

And that's how HN looks when enabled.

Notice that no score are present in the comment header (click on this thumbnail for a higher resolution)

Of course the stylesheet is publicly available on GitHub, you can find the repository at https://github.com/dgellow/hn-no-pressure.

A few days ago we released a new version of HabitCat (v1.9.1) taking in account feedbacks we received from our users:

  • 🌗 Switch between light and dark mode (also known as "night mode")! HabitCat now supports dynamic color schemes, depending on the mode set on your phone the app will automatically select the appropriate scheme.

  • 📆 We received multiple times the feedback that users want to set past data, for example from other applications, and have more control over the starting date of a habit. We agree that's a very good feature, so that's now possible! When creating a habit the start date will default to today, but you can change it to a date in the past then manually fill the data you already have.
Read full post

When reading Svelte 3 documentation of the {#each} keyword, it isn't clear how to correctly handle the case where the variable we want to iterate on is null or undefined.

A common use case is listing the result of an object of type Promise<MyItem[]>. We could imagine for example that this promise represents the result of an HTTP request. We would first initialized the promise to null as a way to communicate that we didn't fetch any result yet.

Read full post