Joined March 2013
·

Cristian Andrei

Web Designer / Front-end Developer at AutoUncle
·
Aarhus, DK
·
·
·

Or you could do this like

%tr{class: ("active" if row.name == "active")}

That way you could also have other attributes besides the class

The first one is an insane way to do queries in Rails. Never interpolate strings directly in SQL statements, it's a huge security hole!

Nice to know about the third option

Posted to JavaScript in-string variables over 1 year ago

I would definitely miss this if I wouldn't use CoffeeScript. It doesn't even use eval, which can be potentially dangerous.

Posted to Stop It With the Vars over 1 year ago

I love the simplicty with which CoffeeScript takes care of that for me

Posted to Saving better SVG files over 1 year ago

Actually the minified version is DRY and not very hard to read. It applies the properties on the parent element (<g>) so the child elements just get coordinates, and don't need to specify stroke color & width for each element. It's like writing DRYer css & html.

Posted to Saving better SVG files over 1 year ago

Am I the only one who noticed the "horseporn" easter egg? :))

Posted to JavaScript inheritance for Beginners over 1 year ago

Interesting technique. I was using Coffeescript to create inheritance. How are you handling super calls from the child object method (not constructor)? What other aspects are different than Coffeescript's implementation?

Thanks for the uptimerobot tip :) Saved me from quite a hassle with trying to set up a curl command in a crontab using dotcloud. For some reason that didn't work.

Achievements
410 Karma
187,747 Total ProTip Views