Code for my talk at Lviv JS 2013 (http://lvivjs.org.ua/)