Origin of the wheel group

Tuesday Feb ‘10 2

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

Friday Jan ‘10 29

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…

Friday Jan ‘10 29

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 →

Checking for CSS rule value support in IE

Friday Jan ‘10 22

I’ve learned to prefer * and _ hacks over conditional comments to target IE for two reasons—users won’t need to make yet another HTTP request, and perhaps more importantly, code in one file is much easier to maintain than the same code in two or more files (DRY).

Recently, it occurred to me that this can also be used as a more granular way to target IE instead of browser sniffing. Similar to testing for the existence of a JS property/method before using it, I can basically check if a certain CSS rule value is supported. Note that this is different from checking CSS rules like -moz-border-radius, which can be directly accomplished in JS.

For example, IE6 does not support position: fixed, but other property values like absolute and relative are fine. So if I want to run some JS code only in IE6 to emulate fixed positioning (lots of existing workarounds use CSS expressions which I’d rather avoid), I can do the following:

#foo {
    position: fixed;
    _position: absolute;
}
var isPositionFixed = (fooEl.style.position == 'fixed');
if (!isPositionFixed) {
    // Special sauce for IE6
}

Here, isPositionFixed will always evaluate to false in IE6 since all other browser will ignore it, which I think is much more reliable and cleaner than user agent sniffing. Admittedly, this does blur the line between presentation and behavior, but it is not a terrible compromise that I’m willing to take.

Till shitty browsers drop off the face of the planet, here’s yet another hack to live with.

Leave Your Reply →

The Longest Date String

Thursday Jan ‘10 21

Given a date format like “Thursday, January 21, 2010” and limited space to drop in this string on a page, what is the maximum width of this string as rendered in Georgia or Helvetica/Arial?

Longest day of the week: Wednesday
Longest day of the month: 22–30 (30 is a hair wider in Georgia)
Longest month of the year: September
Longest years: 2002–2009, 2020 (Yay for a “short” next decade?)

Therefore, the hypothetical longest date string is “Wednesday, September 30, 2009”. Then I discovered that September 30, 2009 is actually a Wednesday. Neat.

Leave Your Reply →

Go France, Go Germany!

Wednesday Jan ‘10 20

A few days ago, I tweeted this. Yesterday on BBC News: France joins Germany warning against Internet Explorer.

The days of the Shittiest Browser on Earth are numbered.

1 Comment →

Internet Explorer can be downgraded!

Wednesday Jan ‘10 20

What do you do when you need to test your pages on three versions of shitty browsers that cannot coexist in a single OS installation? Ideally, I’d have three OS instances that I can RDP/VNC into. However, lacking that luxury, the second best answer is to have three VM instances.

I found out the hard way that a time-bombed VPC image from Microsoft isn’t the answer, since the converted image wouldn’t even get activated in VMWare Fusion. What a waste of time that was.

Thankfully, a helpful colleague pointed out that I can actually downgrade IE. Well, I didn’t know that!

So I simply made a copy of an existing IE7 VM image, ran %windir%\ie7\spuninst\spuninst.exe, waited for Windows to uninstall a bunch of stuff (notably SP3) and hey, back to IE6. Looks like you can downgrade IE8 to IE7 the same way too (just replace ie7 with ie8 in the path), but I haven’t tried that myself.

Ah, the infinite joy of testing shitty browsers!

Leave Your Reply →

Why are special weather advisories always in ALL CAPS?

Monday Jan ‘10 4

It’s a little hard to read?

Leave Your Reply →

Coloring svn diff output on Mac OS

Tuesday Dec ‘09 29

It’s nice to be able to quickly distinguish changes in svn diff‘s output. We can do that with a little Perl wrapper called ColorDiff.

Get ColorDiff

First, install MacPorts if you haven’t already. First snag — my new employer‘s network firewall blocks rsync for some reason, so sudo port selfupdate didn’t work for me. However, turns out that I can also get the ports tree using Subversion or tarball via HTTP.

Next, install ColorDiff using the command sudo port install colordiff. It might help to remind you that sources.conf lives in /opt/local/etc/macports/ by default.

Configure Subversion Client

Open up ~/.subversion/config in your favorite text editor, and search for this line:

# diff-cmd = diff_program (diff, gdiff, etc.)

Add this line right below it (I like keeping the default examples intact):

diff-cmd = colordiff

Et voilà:

Further Steps

The default colors are kinda ugly, but you can customize the color output using ~/.colordiffrc as documented in man colordiff.

3 Comments →

Where The Hell Did I Keep My Databases?

Friday Nov ‘09 13

One of those note-to-selfs — If I forgot where I kept my MySQL databases (in the file system), here’s how I can find out:

$ mysqld --help --verbose | grep datadir

And don’t keep datadir in the installation’s directory. Yikes. MAMP might be a better idea.

Leave Your Reply →