Using stack on NixOS

I’ve got myself a new laptop recently and decided to try NixOS. It’s
been a great experience so far, but there are some rough edges. One
of them is stack not completely working out of the box for my

Continue reading

Posted in Uncategorized | 4 Comments

Using Caps Lock as Menu/Apps keys on Emacs

I’m an ergoemacs-mode user, a mode that changes most key bindings so that they put less strain on your hands.  For example, it uses Alt instead of Ctrl most of the time, which is easier to press: use your curled thumb instead of a karate chop.  Also, many commands are activated by first pressing the Menu/Apps key (that key near the Right Ctrl which usually opens the context menu).  For example, pressing Menu then T allows you to switch buffers.

However, the keyboard on my new notebook doesn’t have a dedicated Menu key.  Instead, one needs to press Fn+Right Ctrl, which is of course extremely painful.

Menu key hidden on the Right Ctrl.


I’ve found a workaround, though.  A very hackish workaround.

Continue reading

Posted in Uncategorized | 2 Comments

Changing NetworkManager route metrics

If you use NetworkManager with more than one interface, you probably want to control the metric of their routes. Here’s one way you can do it.

Continue reading

Posted in Uncategorized | Leave a comment

Sensors detective

I have an Asus M5A97 PRO motherboard, which includes the common set of sensors. The lm-sensors free software correctly detects two chips, k10temp-pci-00c3 and it8721-isa-0290, corresponding to my Phenom II and my motherboard, respectively. However, by default the output of sensors looks like:

Continue reading

Posted in Hacking | Tagged , , , , | 3 Comments

Esqueleto now supports IN and EXISTS

Since version 0.2.9 that I’ve just released, esqueleto supports IN and EXISTS operators (and their negated counterparts). For example:

select $
from $ \person -> do
where_ $ exists $
         from $ \post -> do
         where_ (post ^. BlogPostAuthorId ==. person ^. PersonId)
return person

Enjoy! =)

PS: I’ll try to post more in the future, so keep tuned =).

Posted in Haskell | 3 Comments

Announcing esqueleto, a type-safe EDSL for SQL queries

I’m very pleased to announce a preview release of esqueleto, a bare bones, type-safe EDSL for SQL queries.

Continue reading

Posted in Haskell | Tagged , , , , , , | 7 Comments

Abstracting permissions with Yesod

Yesod is a terrific framework for web applications in Haskell.  It has many, many built-in features.  One of them is that there’s nice support for authentication and authorization.  In this post I’m interested in talking about how you could write your authorization code such that it’s harder to make mistakes.

Continue reading

Posted in Uncategorized | Tagged , | Leave a comment