Présence Française au Japon

Tags: japon

Les japonais aiment beaucoup les États Unis, l’Angleterre, la France… Donc forcément, quand on est français, on remarque un certain nombre de détais amusants, comme la présence d’Orangina, de Volvic et d’Évian dans les distributeurs de boisson (avec des petits drapeaux tricolores, bien sûr), de revues françaises dans les kiosques, de nombreuses patisseries françaises, ou encore des textes entiers en «français».

Une petite compilation de certaines trouvailles est disponible .

Les limites du bluetooth

Tags: japon

En général, les ondes, c’est pas mon truc. Mais le bluetooth®, c’est quand même particulièrement pratique. D’ailleurs, visiblement, je ne suis pas le seul à apprécier ça, vu que dans les endroits les plus bondés, il est simplement satturé.

i3 free workspace

Tags: python, scripts, window-manager

A few years ago, I decided to give a try to some Tiling Window Manager. I began with Awesome, which was… Awesome. But sometimes, you want something new, and I tried XMonad. Great, but kind of hard to configure if you are not eating Haskell for your breakfast.

And a few days ago, I followed some friends and set up i3.

It is almost perfect for me, but it missed one important feature : beeing able to switch to (or move a container to) the next (or previous) free workspace. I think it is really cool to go to the next used workspace with mod4 + , but I needed my mod4 +ctrl + .

So, here is the quick-and-dirty script that let you do that

Then, in your .i3/config:

bindsym $mod+Control+Left exec switch prev
bindsym $mod+Control+Right exec switch next
bindsym $mod+Control+Shift+Left exec move prev
bindsym $mod+Control+Shift+Right exec move next

Well, with this quality of code, I don't think that it could help anybody, but why not ?

Git pre-commit hook & git commit --all

Tags: git, scripts

It's generally good when a task you have to do many times a day is really fast. For example, when I want to make a commit, I just type gc <message>, because I made gc an alias for git commit -am. And when you have to commit, it's hard to go faster.

But sometimes, fast is not enough.

Today, I just tried to add a pre-commit hook that checks pep8 for the python files I’m about to commit. Easy.

The man page says that pre-commit is bypassed when we use the option --no-verify, so everything should be OK.

BUT sadly git commit -a also bypasses the pre-commit hook. And I don't wanna loose my time adding manually all the modified files in the repo. git add * is definitively not a solution.

However, the solution is quite easy: let the pre-commit script do the right git add stuff !

By "the right stuff", I mean git update-index --add, because it seems that on some systems with some versions of git, git add in a pre-commit adds files but for the next commit… 

Here is my implementation of this solution:

Now, you may want to add this pre-commit to all your git repositories in every computer you use… Well, just look at this one (it just takes a ~/.gitrepos which contains all the repositories you use on the current computer… ie the config file for this script