• January 19, 2012

    Non-breaking white space Internet Explorer 8 JavaScript regexp bug (and how to fix it)

    While developing jQuery plugin for upcoming bookmarking "Items in select boxes" plugin for our Vudu CMS

    I wrote a simple regexp to strip few characters (pipe, minus, apostrof and white-space) that are added before the actual item.

     function cleanOptionText(txt)
     {
     return txt.replace(/^[\s|'-]+/, '');
     };
    

    It worked just fine on FF9 and Chrome but in IE8 only the first pipe (|) was removed. After some debugging I discovered that I have both spaces and non-breaking spaces that should be removed and that in IE8 class shorthand \s (which should include all white space) doesn’t include non-breaking space.

    Code for non-breaking space is 0xa0 (dec 160) so regexp should be updated as follows:

    function cleanOptionText(txt)
    {
    return txt.replace(/^[\s\xA0|'-]+/, '');
    };
    

    read more

  • Ubuntu Cloud Live on OpenStack

    crm.com published selection of the 10 Best Open-Source Products Of 2011. On 8th place, you can find OpenStack (an open-source cloud platform) for whom our dear coleague Ante Karamatić is leading Ubuntu Cloud Live project. We are looking forward to new interesting grounds cloud support will bring us in 2012.

    Ante explained: "Ubuntu Cloud is a product. Ubuntu Live Cloud is a custom version of Ubuntu Cloud, customized to work without a disk. OpenStack is a major, if not essential, part of the Ubuntu Cloud."

  • January 16, 2012

    rim – PHP Remote Image Library

    Working on recent home project I found there is no library in PHP to get dimensions of remote images.
    So I made rim php library to get type and size of remote images in optimized way. read more

Proudly running on Word Press, and above all, proudly using Comic Sans.

Nivas.hr © Copyright 2009    All right reserved    Made in Croatia Yeah, we made our own site!Nivas.hr