martes, 29 de octubre de 2013

Keyboard galleries

I recently got a Kinesis Advantage which I'm not yet fully confortable with but I'm getting there. I'll probably explain the pros and cons I found in it in a future post.

 Lately, more and more programmers I know started caring about their keyboards. Some prefer the mechanical IBM M, or newer thinkpad keyboards (with trackpad). In ratpoison's wiki there's a gallery of lots of strange keyboards that ratpoison users have. But today I saw a keyboad gallery that made me really shit bricks.

If you're also a keyboard fan, check it out!

sábado, 26 de octubre de 2013

Memoize in lua

I love how simple and codeless it looks.
 function memoize(func)
   return setmetatable({}, {
     __index = function(self, k) local v = func(k); self[k] = v; return v end,
     __call = function(self, k) return self[k] end

lunes, 21 de octubre de 2013

jueves, 17 de octubre de 2013

Yet Another Find File In Project in Emacs

Every other day in reddit /r/emacs there's someone asking for this find-in-project feature that has sublime/textmate/vim(ctrl-p) users so addicted.  Is there anything similar for emacs?

The answer is (as usual), yes, more than one, probably more than needed.

People are suggesting projectile, prelude, helm or fiplr.  The point is that if the only feature you want is to search on a git repo, and you don't want any of the other sugar that projectile/prelude provide (you already know stock emacs), you can write your own in 5 minutes. So I did. Long time ago, when there weren't so many search packages, and I just wanted a fraction of available plugins offered.

It was also a nice exercise when I was learning elisp.

Here it is:

Sorry again to planet emacs readers. The gist isn't showing properly there.... :/

miércoles, 16 de octubre de 2013

TIL: 2013-10-16

  • C-x 8 is the prefix to insert 'strange' characters in emacs.
Not really easy to use as most of the chars take 2 keypresses more, but anyway, I don't have to enter ç or ñ that often.

The credits for this tip go to Toni.

viernes, 4 de octubre de 2013

TIL: 2013-10-4

In which branches is a given commit? (useful after using git pickaxe)

git branch -a --contains [treeish]

martes, 1 de octubre de 2013

Absolute vs relative times in applications

[m] ok
[m] and do you thing relative time is more useful then absolute one?
[m] or vice versa?
[m] the other one will be on tooltip
[rgrau] day/time for me is the most valuable   
[rgrau] batch processes are at 4:00
[k] I think relative time is more useful if it refreshes automatically
[rgrau] not 8 hours ago
[k] like, each 10 seconds
[m] it refreshes automatically
[k] then yes
[rgrau] but you loose track
[rgrau] because you have to synch every time  
[m] for me relative is for quick check
[m] absolute for serious things
[rgrau] at any scale, I know where am I
[rgrau] (tm)
[m] :D
[m] pfff
[m] because it is not 'ago'
[rgrau] absolute time is the way
[rgrau] if it's shorter 
[rgrau] (tm)
[rgrau] in the app logs, if you have to compare , there's absolute date
[rgrau] and absolute dates do not rely in the global state of the world
[rgrau] it's immutable
[rgrau] so better
[rgrau] (and I mean it (tm))
What's your take?