In the 1790s, when the Bill of Rights was ratified, any two people could have a private conversation—with a certainty no one in the world enjoys today—by walking a few meters down the road and looking to see no one was hiding in the bushes. There were no recording devices, parabolic microphones, or laser interferometers bouncing off their eyeglasses. You will note that civilization survived. Many of us regard that period as a golden age in American political culture. — Whitfield Diffie
Buxton, whose warm waters have made thy name famous, perchance I shall visit thee no more—Farewell. — Mary, Queen of Scots on her last visit to Buxton
17th January 2010; Discussion
The text below was posted on my old blog in August, 2008. Since I still use this technique, I think it is worth moving it here.
Sometimes, you need to know how many times a function was executed and how much time did it take. It is not a problem if you have good profiling tools, but sometimes they are not available. A few months ago I was optimizing my code in some very early Fx3 build and the tools I use were not ready yet (Firebug was too buggy to use and Venkman didn’t work at all). So I was on my own. Fortunately, in javascript, you can monkey patch already created functions and insert your profiling code there:
function p_register(func_name) {
var func = window[func_name];
var h_name = "__" + func_name + "__";
window[h_name] = func;
window[func_name] = function() {
// start profiling
var result = window[h_name].apply(window, arguments);
// store profiling results
return result;
};
}
In the code above, I’ve copied the function and replaced the original with a new one which contains my profiling code and a call to the hidden copy. So, every call to a function I wanted to profile was counted. As for the bottleneck, it was about prototype.js, its `Element.hasClassName` method and elements extension: it was too expensive to use them with a lot of elements, so I wrote a tiny func which acted just as `.hasClassName` but without element extension.
10th January 2010; Discussion

The Seattle Central Library is one of the best things I saw here, in the United States. Not only it has a pretty large collection of books, its building is very beautiful. The 11-story glass and steel building in downtown Seattle, it has wonderful interior, gets tons of natural light and contains a lot of reading spots with power sockets and free wireless internet. And it is free to use for everybody (well, at least I paid nothing and nobody stopped me).
8th January 2010; Discussion
If you are writing an extension for Chrome, it is probably not a good idea to log everything since the browser does not have any limit on how many console messages to store.
7th January 2010; Discussion
Since Google Chrome for Mac now supports extensions I decided to write one. I called it Tessie Notifier and all it does is display the status of the latest Disqus build. At work, we have special, testing-only machine called Tessie that automatically runs all the tests after each repository commit. It then generates a nice little report page. So my extension loads the page, checks the status and updates a browser-action icon.

(The ball on the right; it is blue (image of Neptune) when all tests passed, orange (Sun) when there are failures and white (Eris) when Tessie is not available. Also its tooltip shows latest commit information and clicking on it will load the report page for you)
Development process is pretty nice and simple. There is only one configuration file to write—JSON-formatted manifest file—and everything else is basically HTML and JavaScript. If you are using background page, debugging your extension is just like debugging any other site on the web using WebKit development tools. And there is also no need to pack the extension and restart your browser every time you want to try it out.
As a conclusion, here is the complete source code: tessienotifier. Consider it only as a code sample since I doubt that the actual extension could be of any use to anybody who is not working at Disqus.
A list of things you should do when committing, and why you should do it.
Page 2 of 7