dira ⋅ geek ⋅ girl

New friends, new enemies


web geek’s (un)conference in Bucharest was about saving secondsThe talks were about improving all those little things that you do often and, even if the duration of each one has a magnitude of seconds or less, overall they eat your time – and sometimes your brains.

So after giving more timeslots to the thread that was monitoring by keystrokes and neuron anxiety, i got:

2 new friends

Meet jack and sack – the time saviors:

# ack
alias ack="ack-grep -i -a"
jack() {
  ack $1 --ignore-dir=vendor --ignore-dir=cache --ignore-dir=stubs public/javascripts
sack() {
  ack $1 public/stylesheets/sass

jack searches through the javascript files – that’s everyting in /public/javascript excluding libraries ( /vendor ) and the folder with all the js’s compacted and and cached ( /cache ). So that’s

jack searched_stuff

instead of

ack-grep  -i -a --ignore-dir vendor --ignore-dir cache --ignore-dir stubs searched_stuff public/javascripts

I rely on jack for finding things like ‘where is this method called’, ‘who listens to this event’ and ‘is this CSS identifier/class used just for formatting or is the javascript referecing it too?’.

sack is the little brother that does the same kind of search in the Sass files. The gain: that I don’t have to type the /public/stylesheets/sass path anymore.

2 new enemies

The new “enemies” are external services that I didn’t need during development, and that annoyed me in one way or another. No more!

gmaps. GMaps is a central part of symbolya ; while it is by no means slow, it still consumes a couple of seconds on every load. That can be most annoying (read: brain-power eater) when I am working on the pages that include the map, but I am changing or testing something else.

Solution: stub it!

I created a dedicated environment, in which the real GMaps js is replaced with a local stub that creates classes with the same names as the ones we use from GMaps,  returns some fake data when needed and plays dumb for the rest.

Time saved: 2-3 seconds/per page load. Brain power: priceless.

crowdsoundIncluding crowdsound leads to a JS error and the nice red error icon in Firebug made my brain freak out every time I saw it. That is, every time I was looking at the site during development.

Solution: remove it from the development environment(s) – where it is not used anyway. No more brain panic ftw!