I am Hack Sparrow
Captain of the Internets.

Archive for May, 2011

Firefox: Content Encoding Error. What’s Up?!!

Since sometime (after I upgraded to Firefox 4.0.1), I often encounter this weird Content Encoding Error. This happens especially on YouTube and some other blog sites for me. And I think it is most likely a bug in Firefox. The whole error message looks like this: The page you are trying to view cannot be shown because it uses an invalid or unsupported form of compression. ...

Reversing an Array in JavaScript

Reversing an array in JavaScript is pretty straightforward: the JavaScript object comes with a method that does the reversing natively. The usage example is given below: [js] var a = ['AC/DC', 'Aerosmith', 'GNR']; console.log(a); // ["AC/DC", "Aerosmith", "GNR"] a.reverse(); console.log(a); // ["GNR", "Aerosmith", "AC/DC"] [/js] Note: the Array.reverse method is destructive, meaning it will modify th ...