Young Lions Finland – third prize goes to…

youg lions karkimedia julius haukkasalo1 Young Lions Finland   third prize goes to...

We didn’t win the ice hockey world championship… We didn’t win the Eurovision song contest… But who cares! Our graphic designer Julius and his friend Henri Koponen was awarded the third prize of Young Lions Finland design competition in print category! In addition to that they also honored a “merit” in cyber category. Click here to see all winners.

Congrats guys!

Two reasons to love underscore.js

I’ve recently started to include undescore.js library to all JavaScript applications and sites I create. Underscore is a small library providing “a lot of the functional programming support that you would expect in Prototype.js (or Ruby)”. I originally found this library when using Backbone.js framework.

Underscore provides about 60 functions, but there are two that I’ve found especially useful.

1. bindAll
I’ve never really understood JavaScript’s this-context and why it’s implemented so oddly. When binding object’s method as an event handler, object context is lost making this-keyword fairly useless.

But hopefully we have Underscore and bindAll. It binds a number of methods on the object to be run in the context of that object whenever they are invoked.

See this example stoled directly from documentation:

var buttonView = {
label : 'underscore',
onClick : function(){ alert('clicked: ' + this.label); },
onHover : function(){ console.log('hovering: ' + this.label); }
};
_.bindAll(buttonView);
jQuery('#underscore_button').bind('click', buttonView.onClick);
=> When the button is clicked, this.label will have the correct value...

2. Templates
I found myself writing a code like this:
var html = "<h1>Menu</h1><ul><li>"+item1+"</li><li>"+item2+"</li></ul>"

Which is… wrong. You should never mix functional code and presentation. Underscore has a simple template function, which allows you to separate markup from JavaScript.

You can define template on your html-source:

<script id="my-template" type="javascript/template">
<h1>Menu</h1>
<li><%= item1 %></li>
<li><%= item2 %></li>
</script>

And then render it on JavaScript side:

var template = _.template(jQuery("#my-template").html());
var html = template({ item1: item1, item2: item2 });

No more messy html within JavaScript!

With these two simple functions my life gets much easier icon smile Two reasons to love underscore.js

Caching matters

We are developing a WordPress site for a popular brand and we’re expecting high traffic. So I installed WordPress Super Cache plugin and did some measurements with Apache Benchmark. Results are obvious (requests per second, 10 concurrent users):

wordpress super cache plugin performance results 2 Caching matters

This if nothing proves that caching matters icon smile Caching matters

Etera – Christmas E-Card

Hahaaa! We had to design and animate a christmas themed e-card for Etera in Flash. Now its LIVE for the masses! The projects schedule was very swift and there wasn’t much time to polish everything. Nevertheless the final result is pure awesomeness.

Check it out by going to: Etera Christmas E-Card and click to play the “lumiukko” animation.

Merry Xmas!

etera snowman1 Etera   Christmas E Card snowman etera E Card