The Missing Bit


Using address sanitizer with rust and C libraries
August 10, 2020

For one of my project, I am writing a mix of Rust and C code. I have to write quite a bit of unsafe Rust to call my C functions.

I had some subbtle memory corruption and I couldn’t find the issue.

After a while, I was able to enable the AddressSanitizer, here is how.

Read more

Using Firefox on Wayland with X11 apps
July 18, 2020

I use sway on wayland, and one annoyance I had, is this error:

firefox error

Read more

In HTML emails, always set text and background colors in pair
June 7, 2020

My system has a dark theme, which means my thunderbird has a dark theme too.

The problem is very simple, when an HTML email sets text color only, without setting background color, the email becomes unreadable.

Read more

TIL - Rust crate lib and binaries are separate compile unit
May 6, 2020

Given a rust crate with three files: When and are compiled, they are each compiled in their own independant compile unit. This means that we have to put mod common inside each file. But the better approach is to put mod common inside and do use my_crate_name::common inside or other binaries within the crate.

TIL - Lazy git is a nice TUI git client
April 30, 2020

Today I discovered lazygit which is a great terminal UI client for git. I really like it because I can use it in my terminal workflow to commit specific lines of code easily. I use it with tig. Tig is for repository browsing and lazygit for staging and commit.

TIL - Rust vec.resize() is slow in debug
April 25, 2020

I was doing some tinkering with OpenGL and some code I copied from the example used Vec::resize() to resize a vector. And I discovered this was terribly slow when not compiled for release.

Read more

TIL - EGD Erlang library
April 23, 2020

I use elixir in a lot of project, but I am not very familiar with the erlang eco-system. My wife was taking an elixir course and she had to use the :egd library. It’s a very simple image library where you can create draw surfaces then on them you can draw line, ellipse, rectangle and text. While it is quite limited, it might come handy for simple uses. Doc:

Today, I start writing my TIL (Today I Learned) on this blog
April 23, 2020

Today I saw this repository and I realized it would be very cool to start doing that. I often struggle on what to write on a regular basis, and I think going for “TIL” is nice way to share knowledges without having to write a full post.

Managing colors on Android with HSLuv
March 9, 2020

Android do not provide HSLuv support out of the box, here is a little trick to generate Android colors from an HSLuv source.

Read more

HSLuv, a developer friendly perceptual color space
March 8, 2020

As a developer, managing colors can be tedious, but there are “developer friendly” solutions, HSLuv is one of them and I will explain what it is and how it can help.

Read more