The Missing Bit

Posts

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

Given a rust crate with three files: lib.rs main.rs common.rs When lib.rs and main.rs 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 lib.rs and do use my_crate_name::common inside main.rs 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: http://www1.erlang.org/doc/man/egd.html

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

Today I saw this repository https://github.com/jbranchaud/til/blob/master/README.md 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

Introducing Base24
February 27, 2020

TL;DR:
Base24 is a binary-to-text encoding aimed at encoding short keys (32-512 bits) for human usage.

Read more

Setting up an android app from scratch without IDE
January 12, 2020

I am starting Kotlin development for Android, and as for all my developments, I’d like to use vim and command line. There are many reasons motivating me to ues a bare setup without an IDE like controlling everything, using my current toolchain and learning.

This post will describe how to make a Hello World Android application using only a text editor and command line tools.

Read more

Accessing GPIO on the beaglebone black with rust
September 5, 2019

For a small project, I needed to be able to control some GPIO with Linux. I had some experience with the raspberry pi, but I wanted something more open (hardware wise). I tried the beaglebone black wireless, and was pleased with the experience. I had a minor issue, is that accessing GPIO with sysfs was slow (like 3Khz), and I wanted much faster GPIO.

I toyed a bit with it, and found a lower level solution I explain in this post. It’s in rust because I am learning the language, but it’s low level, so you should be able to do it in C.

Read more