Posts

On User Agent Sniffing

Oh well, who was following me on twitter today is already bored about this topic (I guess) but probably other developers would like to read this too so ... What Is UA Sniffing UserAgent sniffing means that a generic software is relying into a generic string representation of the underlying system. The User Agent is basically considered a unique identifier of " the current software or hardware that is running the app ". In native applications world UA could be simply the platform name ... where if it's " Darwin " it means we are in a Mac platform, while if it's Win32 or any other " /^Win.*$/ " environment, the app reacts, compile, execute, as if it is in a Windows machine ... and so on with Linux and relative distributions. The "Native" Software Behavior If you have an hybrid solution, example those solutions not allowed anymore but called Hachintosh not long time ago, your machine has most likely Windows Starter capable Hardware but it...

JS getCSSPropertyName Function

I was re-checking @LeaVerou talk at jsconf.eu looking forward to see mine there too to understand how to improve and specially what the hell I have said for 45 minutes :D Lea made many valid points in her presentation but as is for supports.property case, you never want to go too deep into a single point of your talk so ... here I come. getCSSPropertyName Function This function aim is to understand if the current browser supports a generic CSS property. If property is supported, the whole name included prefix will be returned. var getCSSPropertyName = (function () { var prefixes = ["", "-webkit-", "-moz-", "-ms-", "-o-", "-khtml-"], dummy = document.createElement("_"), style = dummy.style, cache = {}, length = prefixes.length, i = 0, pre ; function testThat(name) { for (i = 0; i < length; ++i) { pre = prefixes[i] + name; ...

News

So we just got back from a little Canadian weekend with Thee Oh Sees. We had a blast. There is a lot going on in our world at the moment so we've been a bit busy - sorry for the lack of updates here. We have a whole bunch of upcoming shows, check out the shows section to your right - these include shows with SEX CHURCH, a mini-tour with PYGMY SHREWS, a couple of shows with RUSSIAN CIRCLES, and a little European tour in December. If any of you euros cant make it to see us in December, we will be back in January for a little over a month, and we are very excited. We have a new LP done, it will be out in March on Sacred Bones Records and much touring in support of it shall follow. We have also been informed that Karmic Swamp Records is repressing the "Think" 7" that came out last year. There were only a handful of those pressed so hopefully people that missed out on getting them can grab one now. We will post here when it is available. Also, thanks to everyone who has o...

My BerlinJS Slides

It was a great event today at @co_up in @berlinjs meet-up and here are my sides about wru which accordingly with today meeting means where are you , directly out of SMS syntax. Enjoy ;)

Playing With DOM And ES5

Image
A quick fun post about " how would you solve this real world problem ". The Problem Given a generic array of strings, create an unordered list of items where each item contains the text of the relative array index without creating a singe leak or reference during the whole procedure. As plus, make each item in the list clickable so that an alert with current text content occur once clicked. The assumption is that we are in a standard W3C environment with ES5+ support. The Reason I think is one of the most common tasks in Ajax world. We receive an array with some info, we want to display this info to the user and we want to react once the user interact with the list. If we manage to avoid references we are safer about leaks. If we manage to optimize the procedure, we are also safe about memory consumption over a simplified DOM logic ... How would you solve this ? Give it a try, then come back for my solution. The Solution Here mine: document.body.appendChild( /* input */[...

Do You Really Know Object.defineProperty ?

I am talking about enumerable , configurable , and writable properties of a generic property descriptor. enumerable most likely the only one we all expect: if false, a classic for/in loop will not expose the property, otherwise it will. enumerable is false by default. writable just a bit more tricky than we think. Nowadays, if a property is defined as non writable, no error will occur the moment we'll try to change this property: var o = {}; Object.defineProperty(o, "test", { writable: false, value: 123 }); o.test; // 123 o.test = 456; // no error at all o.test; // 123 So the property is not writable but nothing happens unless we try to redefine that property. Object.defineProperty(o, "test", { writable: false, value: 456 }); // throws // Attempting to change value of a readonly property. Got it ? Every time we would like to set a property of an unknown object, or one shared in an environment we don't trust, either we use a try/catch plus double ...

The Men are going to Europe In December

Here are the dates: 12/7/2011:  Paris, France , Espace 12/9/2011:  Dijon, France , Consortium- Generiq Fest (w/Cults) 12/10/2011:  Belfort, France , Poudiere (w/Black Lips) 12/11/2011:  Strousbourg, France @ TBA 12/12/2011:  Rotterdam, Netherlands , Exit 12/13/2011:  London, UK , Madame Jojo’s White Heat 12/14/2011:  London, UK , Shacklewell Arms