Sunday, February 16, 2014

Is NodeJS the best solution for your project

Ever since all the commotion around NodeJS started, I was wondering, if javascript is really good for backend development. So I started looking up various subjects regarding NodeJS, like how to configure a production server, benchmarks and others. After doing some reading I was able to form an opinion.

Thursday, February 13, 2014

CSS class generator using SASS

Sass give us a lot of flexibility when we are building big web apps. One of my favorite function is to be able to create css classes by using a loop:

@mixin zoom($scale) {
    $scale: $scale / 100;
    -webkit-transform-origin: 50% 0;
    -moz-transform-origin: 50% 0;
    -ms-transform-origin: 50% 0;
    -o-transform-origin: 50% 0;
    transform-origin: 50% 0;
    -webkit-transform: scale($scale);
    -moz-transform: scale($scale);
    -ms-transform: scale($scale);
    -o-transform: scale($scale);
    transform: scale($scale);

$zoomFactor: 100;
@while $zoomFactor >= 20 {
    .zoom-#{$zoomFactor} {
        @include zoom($zoomFactor);
    $zoomFactor: $zoomFactor - 10;

Create a jquery extension for handling dom insert events

Very often when I'm building a web application, I need to dynamically create some objects and append them to the dom. Well thats ok, but if there are some additional calculations that you need to do after inserting your objects, then things are getting a bit messy. For example you need to position your objects according to a relative parent object's dimensions or initialize a plugin that requires your object to appended to the dom.  Well there is always a way of getting around issues like that, but I wanted to keep thing simple and to do that I needed some king of "onDomInsert" event.