Search website

Using RVM for quite some time? You should clean it up a bit

I can't even remember the last time I ran rvm implode, I'd reckon I've been using RVM for about three years. Sure: I always update it via rvm get stable but I never really clean up old Rubys or gems, I only run bundle clean --force in each repository from time to time since I don't always use bundle exec. In any case, ...

Making Rails asset pipeline faster

We all know that for a rather large Rails app where the front-end is quite stuffed, the asset pre-compilation and more importantly - development mode changes are far from instantaneous. The front-end we're referring to is the kind that makes heavy use of sass, sass libraries (Compass, Bourbon, etc.) and transpiled ...

How to Web conference, random thoughts, mostly live - five years later

Almost five years since the last post about How to Web [0] - wow that's some large slice of space-time continuum. I recall I almost started this blog for stuff like this, good memories [1]. Half a decade later, what's changed one might ask? Well, the scale looks bigger and so far the talks have been interesting at least ...

Shedding some light into UUID version 4 in Ruby and Rails

Ruby's standard library and Rails's PostgreSQL adapter use by default version 4 UUIDs. This can be changed in Rails migrations via: default: 'uuid_generate_v1()' param whereas Ruby's stdlib only supports version 4. Another interesting difference is in the implementations: In the Ruby's stdlib the UUID method is found in ...

The half-life of a programmer

Half-life (t1/2) is the amount of time required for the amount of something to fall to half its initial value. The term is very commonly used in nuclear physics to describe how quickly unstable atoms undergo radioactive decay, but it is also used more generally for discussing any type of exponential decay. I had this ...

Ruby 2.2.0 Preview 1 quick Rails benchmarks

Great news everyone! Ruby 2.2 preview 1 has been released ! I'm really curios about the Incremental GC and Symbol GC so let's run some quick Rails benchmarks on a normal Rails API app. First off let's install the preview via RVM: rvm install ruby-2.2.0-preview1 After fiddling around about five minutes trying to find a ...

Improve Rails performance by adding a few gems

Working with Rails for some time you start nitpicking on how to improve it. This is a first in the series of articles regarding on how to improve (even marginally) Rails's performance. I'll focus on a bunch of gems that speed up, in some cases considerably, small parts of Rails, like the html escaping, the String#blank? ...

Is Rubinius 2.2.3 production ready ?

Ruby 2.1 was released this Christmas, great news everyone! It sports a better GC (RGenGC - gerational GC), hierarchical method caching, some small syntax changes and non-experimental rafinements. All in all one can expect 5% to 15% performance increase which is quite awesome. As I was reading the comments in the hacker ...

How to reduce the size of your VMs

As the host OS I use Windows 8 (just upgraded to 8.1), well why ? one might ask.Is rather simple: Steam and after some dreadful searching and configuring tools I managed to install the basics for writing and deploying code: Vim, Git, PuTTy and a decent console replacement like Console2 [0]. Of course those aren't enough ...

Chunked transfer encoding in Rails (streaming)

Anyone that has written a little PHP knows what the flush() family of functions do. The ideal usage scenario for using chunked transfer[0] is when we have something costly to render e.g. the first three most recent articles on a blog. Why ? one might ask. Is rather simple: in a normal request where the server responds ...

On Ruby modules and concerns

Modules are useful for highly specialized code that can be injected into other classes for fun and profit or for creating Namespaces. An interesting approach is to use modules as an alternative to classical inheritance (without its the usual trade-offs) : the core idea is to share an abstracted role that can be included ...

On zygohistomorphic prepromorphisms

There are words in programming that look like jokes. Zygohistomorphic prepromorphism is one of them. The first time you encounter it, you assume one of two things must have happened. Either someone lost a bet, or category theorists were left unsupervised for too long. Both explanations feel plausible. And yet the term ...

On semantic Ruby block constructs

I was cruising around my Github notifications and I found an interesting open issue created by Jim Weirich : “The Semantic Rule for { } VS do/end” in the Ruby style guide repository . The semantic rule says use { } for blocks where the primary purpose of the block is to return a value, use do/end for blocks where the ...

On Ruby 2.0 memory usage, Unicorn and Heroku

On UNIX-like operating systems (e.g. Linux) there's the concept of process forking via the fork() system call. When one calls fork from a parent-process it will spawn a new child-process - that is a copy of its parent, then both processes return from fork. The child-process has an exact copy of the parent's memory in a ...

On font rendering consistency across browsers

Back in the day (i.e. when Firefox's version was a single digit) font rendering was at its best on Mozilla's browser. I remember comparing Firefox's anti-aliasing to the new-kid-on-the-block Chrome : the difference was huge. Time went by and we all know what happened : most web developers found themselves using Chrome ...

On unnamed abstracts, entities and happiness

When I look upon my day to day behavior the pattern that pops out is that of abstracted sets of ideas interchanging one another or making connection to other entities, bringing them in the foreground, into my field of subjectivity. We try to to make perception ours thus abstracting it away in nicely grouped entities ...

On writing artisanal code

Every artisan at a certain point in time just stops and starts thinking about the inner-workings of his craft. He ponders on the whole process from an Outside while trying to make connections between apparently dissimilar entities that his craft is made of. One might argue that this is a purely subjective endeavor: ...

Buzzwords and manifestos

Do we really need them ? I mean sometimes I ask myself what’s the point of all the so-called ways to get things done or tons of guides for getting you to be a “better” you, like NLP, the secret of life and all that stuff. To quote Nassim N. Taleb: “I went to a happiness conference: researchers looked very unhappy” - ...

The inherent entropy in our lives: to resist or to...

I’ve started thinking about it after I read this article and this tweet got me going for a couple of days: “My whole life I’ve been fighting entropy, maybe it’s time I stop fighting” by @stevenbristol . I love stuff like this, makes me ponder on what would be the best way one could choose and what would the solution ...

Using Firebug as a scalpel, yet not for web development

Needless to say, I’m an avid user of Firebug , let’s face it: without it, web development would suck big time, yes we do have other variants but firebug remains the status quo, for me at least. Yet this is not an article about how to develop web apps with Firebug, no, is an article about how one can use it to have a ...

Programatica 2010 after thoughts

Yes, I’ve attended one more conference Programatica 2010 , this one was axed on programming. It started with some interesting to not so interesting presentations of the partners. What I’ve loved about them, was that they contrasted each-other pretty nicely to a point when it was actually funny. I’ve observed something ...

A few words on frontend performance optimizations

I love optimizing stuff, sometimes I even break the rule (when I have time) and optimize just for the sheer fun of it. I’ve been using on my blog RequireJS for some time but the last days I’ve rewritten the whole init script to use LABjs “Why would I do such heresy ?” Well, mostly because I din’t liked the way RequireJS ...

The frontend backend debacle

I’m really starting to get fed up with this useless separation. (Warning: strong personal opinions, based on arguments fallowing). Ok, it’s not useless, I get the idea in a big team, separation of concerns, better productivity and all that. That’s good and I’m all for that, makes things faster (in the big picture at ...

How to Web Conference, random thoughts, mostly live

Sadly, today I’ve arrived a bit late, where "a bit" means a lot; I’vevolatile and utopic place most of the time. In very few domains you can take an idea and with small or no resources (money) and bring it alive and running. I mean, actually thinking about it, how can’t that be exciting ?! Having an idea and turning ...

Tomorrow is the first day of How to web 2010, this should be fun

Just got in Bucharest, tomorrow I’ll be at How to Web 2010 . Hope it’s going to be good, the presentations look juicy. I hope I’ll meet some inspiring people and hopefully something to burst some new ideas or perspectives about the web. All in all, its not such a simple subject like: "oh, so you do web stuff ? isn’t ...

Installing a rails mysql stack on my laptop was a bit tricky

I’ll keep this short: firstly I’ve downloaded the ruby windows installer from here , at the time of writing the version was _1.9.2-p0. _The problem with this one is that ruby crashes into oblivion from time to time (mostly after lots of page refreshes); after a googler search I’ve found out it’s a windows bug (yeah on ...

How I speeded up my browsing experience by a really nice margin

From time to time I like to optimize a bit my Windows machine, yet mostly all I do is fine tunning, nothing really spectacular. This time while I was browsing the net and thinking about one of my old nags (browser performance loading several tabs, to more exact: Firefox loading up 20+ tabs) I realized something really ...

Building a small blog cms in rails

Yes, building a blog cms in rails is apparently very simple, well to be true it’s simple if you want something really limited like a post model, a couple of static pages, controllers and one for the contact form and you’re settled. Actually for something like this one can use Sinatra (not to say that Sinatra is better ...

Back No more pages!