Ruby: Delegator chains

Not my job. You do it.

Have you ever heard of SimpleDelegator? It’s a pretty useful tool; it’s basically used to extend an instance’s behaviour with more methods without modifying its base class (extension is good for code maintainability!). [Read More]

Javascript: Handle bytes sizes

Because bytes are too small

Imagine that you’re using bytes sizes in your javascript code. For example, handling files. Most libraries use bytes as the common unit to manage sizes. However, what if you want to humanize those values into your view? Instead of printing 1234567899 Bytes, you should print 1,23 GigaBytes. [Read More]