Monthly Archives: March 2011

How to register to vote by mail in Canada

The Elections Canada web site is very confusing. If you wish to register to vote by mail in Canada, download one of two “Application for Registration and Special Ballot” forms: For electors residing in Canada For Canadian citizens residing outside … Continue reading

What to do when you get a new credit card

As soon as you get that shiny new credit card, do the following: Activate the card. Call the 800 number on the sticker and answer the IVR prompts or convince the human that you’re real. Sign the card. If you … Continue reading

HOWTO count words in JavaScript

Here is a handy JavaScript function for counting words: String.prototype.countWords = function(value) { // remove html tags var cleanedText = this.replace(/< .[^]*?>/g, ' ') // remove numbers and punctuation .replace(/[–—.(),;:!?%#$‘’“”'"_+=\/\-]*/g, '') // remove/coalesce space chars .replace(/(&nbsp;|&#160;|[ ])+/gi, ' '); // … Continue reading