24 November 2008

Greasemonkey-ing with Gmail's Styles

Last week, Google finally gave us some options to customize the look of Gmail. Excitedly, I went through each theme trying to find my replacement for the boring old "Classic" one. Many of them are graphically appealing, but unfortunately, most of them also have poor contrast compared to "Classic". I finally settled on the "Mountains" theme, but one thing still bugged me about it: the text color of mail titles were too light.

Determined to fix this, I broke out Firebug, the trusty HTML/CSS inspection plugin for Firefox, and found the offending CSS:
.AnqB9d {
color:#3F586D;
}
Then, I created this little Greasemonkey script:
function addGlobalStyle(css) {
var head, style;
head = document.getElementsByTagName('head')[0];
if (!head) { return; }
style = document.createElement('style');
style.type = 'text/css';
style.innerHTML = css;
head.appendChild(style);
}

addGlobalStyle(
'.AnqB9d {' +
' color: black ! important;' +
'}'
);
Viola! Readable mailbox items! Check out before and after shots:

Before:


After:


Related Links:

07 November 2008

F# and Functional Language Respect

I have been experimenting with Microsoft's F# language, their version of ML / OCaml for the .NET Framework. Microsoft recently announced that F# will become an official part of Visual Studio, up there with C# and Visual Basic. I had never really used an ML-based language before, so I was not sure how big the learning curve would be, but I find that my knowledge of Haskell gets me far enough to feel comfortable writing simple programs after looking over the documentation for a few minutes. On top of that, the current pre-release version of F# has near perfect integration with Visual Studio, including an interactive REPL, debugging, and syntax completion. If you are in the market for a good functional language and are in the Microsoft developer ecosystem, F# seems like a great choice.

I'm not sure how much I will use F# at work, if at all, but it is good to see that functional languages are being taken very seriously at Microsoft now. Not only are the developments of F# encouraging, but each new version of C# adds more functional features, and I find myself using those features daily in my work.

Recommended Sites: