Blog

Killing productivity with push notification

..push email is a mortal enemy of flow state and is part of a conspiracy to prevent you from solving any remotely complex problems. Checking email should be a conscious decision, done when it makes sense as part of your individual schedule, rather than a motor reflex in response to the rest of the world’s perceived urgencies.

Read more: I Quit Information For Three Months & Nothing Bad Happened/

Stylus mixin for Rem Font Sizing

font-size(_size)
    if typeof(_size) == 'unit'
        if unit(_size) == 'rem'
            font-size (_size*10)px
    font-size _size

//Usage
p
    font-size 1.2rem

yields

p{
    font-size: 12px;
    font-size: 1.2rem;
}

Update: Fixed font-size: normal. Thanks icylace

LESS.js contribution

Less.js has code that I wrote :). Sweeeet.
Teh merge

ColumboJS inline-script loader

ColumboJS is a simple inline-script collector which executes scripts after dependencies loaded at footer for example.

There are several cases where you want to stick to load js libs at the end of the html but the backend framework cannot collect the component’s related js files instead they vomit them inline. With ColumboJS loader you can delay loading dependencies like the AMD way but it is more lightweight. Like a ponie. With wings.

Demo | GitHub

Nifty debug console

columbojs

Usage example

<html>
  <head>
    <script src="columbo.js"></script>
  </head>
<body>
...
  <p> Some html</p>

  <script>
    Columbo.add('Initialize tab view', function( $ ){  
      // Your component's script here
      $('.m-tabbar').tab();  
    });
  </script>

  <footer>
    Footer or whatever

      <script>
        Columbo.add('Footer social share', function( $ ){  
          // Bind social icon's events or whatever
        });
      </script>

  </footer>

  <script src="load/jquery/here"></script>
  <script src="load/jquery/plugins/here"></script>

  <script>
      Columbo.run($);
  </script>
</body>
</html>

My first smartTV app has been landed in Samsung App Store

It is 8tracks player, replica of 8tracks.com. Without login capability. Currently it’s available in the US, but hopefully next release will unlock Hungary and even all the European regions also.
(more…)

10 years later

CSS

I just realized that colorless border definition inherits its border-color from the element’s color definition.


div{
  color: red;
  border: 1px solid;
}
I’m red. Really.

My first component is in Joomla! Extensions Directory called Vimeo Listing


It passed QA and is now available as Vimeo Listing

The funny thing is that it was made on a rainy weekend in January. After I had sent it for validation it took more than a month till I got the first feedback from the Joomla! QA team. Then I fixed the reported errors. A week later my extension was simply disappeared without any feedback. So I uploaded it again and another two month later they managed to take a look at it and approve.

How magnificent! I’m done with Joomla. Big time.

jQuery consistency fail

jQuery.each( collection, callback(indexInArray, valueOfElement) )
jQuery.map( array, callback(elementOfArray, indexInArray) )

Now I know why I have to start a $.map and $.each always with


$.map( elements, function ( i, el) {
    console.log(i, el);
});

and switch if I fail..

http://api.jquery.com/jQuery.each/
http://api.jquery.com/jQuery.map/

Use .bind() instead of _this, that, me

var myObject = function() {
    this.names = "pony,cat".split(",");
    this.prefix = "Mr. ";

};

/* 
 * You can avoid _this/that/me extra aliases like here
 */
myObject.prototype.getNames = function() {
    var _this = this;
    return this.names.map(function(name){
        return _this.prefix + name;
    });
}; // ["Mr. pony", "Mr. cat"]

/*
 * with function(){}.bind(this);
 */
myObject.prototype.getNames = function() {
    return this.names.map(function(name){
        return this.prefix + name;
    }.bind(this));
}; // ["Mr. pony", "Mr. cat"]

AMD Module boilerplate with global fallback

(function (window, undefined) {

    var PoniesModule = {
        info: "Yeeey"
    };

    // node
    if (typeof module === "object" && typeof module.exports === "object") {
        module.exports = PoniesModule;
    }
    // window 	
    else {
        window.PoniesModule = PoniesModule;
        // requireJS  
        if (typeof define === "function" && define.amd) {
            define("poniesmodule", [], function () {
                return PoniesModule;
            });
        }
    }

})(this);

Usage example

require.config({
    paths: {
        "poniesmodule": "http://jsbin.com/uyucoq/latest.js"
    }
});

require(['poniesmodule'], function (poniesmodule) {
    console.log('app.init..', poniesmodule);
});

Demos: definition | usage

I think one thing is missing: delete global after loading module with requireJS..