Is this why IE6 doesn’t support PNG24?

March 8th, 2010

So Mosaic’s source code has just been released on GitHub, and a sharp eye at Reddit has already spotted this gem (keep in mind that IE is originally derived from Mosaic).

Assuming that IE was actually derived from this code base, may I present the reason we had to work around PNG24 for almost a decade:

/* its #if'ed out for now cause I don't have anything to
   test it with */

Leave Your Reply →

HTML5: <!DOCTYPE html>

March 7th, 2010

All the cool kids have started using the new HTML5 doctype:

<!DOCTYPE html>

It triggers standards mode even in shitty browsers, so we can dump its verbose predecessor and start blazing a path of HTML5 glory.

Leave Your Reply →

HTML5: <meta charset="UTF-8">

March 5th, 2010

The old way:

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

The HTML5 way, which works on all browsers:

<meta charset="UTF-8">

Even though the charset can and should already be set in the HTTP response header, the meta tag is still relevant when the document is offline.

Leave Your Reply →

Naming conventions should follow the language

March 3rd, 2010

For example, id, class and attribute names should be in lowercase-with-dashes in HTML/CSS; JavaScript names should be in camelCase (better defined here); and anything in URLs (including file names) should be in lowercase not only because of conventions, but for cross-platform compatibility as well.

Please, avoid crazy shit like ab_someName and keep things consistent!

Leave Your Reply →

F.lux: better lighting for your screen

February 26th, 2010

F.lux adjusts the color temperature of your screen to match your lighting and time of the day.

Leave Your Reply →

Optimize only when you have a reason to.

February 24th, 2010

Measuring Javascript Parse and Load

While studies like this are fascinating to observe and to learn from, be very careful — unless you’re doing something like distributing JS libraries, these optimizations probably do not apply to you.

Keep in mind that the parse-and-load test runs 1000 iterations; in the first table, the actual average parse time is really only 0.125ms at worst and 0.003ms at best. Compare that to the average HTTP request — you might see sub-30ms responses just for a HTTP 304 on a good day, but 1000ms+ responses are not unheard of on unprimed caches (even more with DNS lookups). To put this into perspective, a snappy HTTP request at 30ms is more than 200 times slower than the slowest parse time of 0.125ms.

In other words, the net improvement you might gain from such parse-and-load optimizations is insignificant compared to the improvement from removing just one HTTP request.

So before you go adding more lines of code to accomplish yet another new trick, profile your code to see where the actual bottlenecks are. Otherwise, this smells like a lot like premature optimization.

Leave Your Reply →

Always check your permissions!

February 17th, 2010

Note to self — Apache (stock on Leopard, which runs as _www) cannot read the preset directories in my home directory (like Desktop, Documents, Downloads, Library etc) because these directories only allow owner access by default (drwx------).

So that is why PHP won’t include files on my desktop. D’oh.

Leave Your Reply →

Origin of the wheel group

February 2nd, 2010

Ever wonder how the wheel group in /etc/group came to be?

“The guy who wrote the group functionality was both a buddhist and a Journey fan. He was listening to “Wheel in the Sky” while trying to figure out a way to give more people administrative rights without giving too much access. In a fit of enlightment, he came up with a special group for administrators. Since they were the ones who kept things turning, it only seemed appropriate that “wheel” be immortalized in the /etc/group file.”

Leave Your Reply →

Google begins IE6’s death march

January 29th, 2010

Modern browsers for modern applications

“We’re also going to begin phasing out our support, starting with Google Docs and Google Sites. As a result you may find that from March 1 key functionality within these products — as well as new Docs and Sites features — won’t work properly in older browsers.”

Leave Your Reply →

In light of iPad’s unveiling…

January 29th, 2010

A couple of choice quotes I found on “A message to the Internets regarding the iPad”:

“You can’t just ask customers what they want and then try to give that to them. By the time you get it built, they’ll want something new.”
— Steve Jobs

Subsequently spotted in the comments:

“If I had asked people what they wanted, they would have said faster horses.”
— Henry Ford

Leave Your Reply →