jsha/README

a blog by Jacob Hoffman-Andrews

Archive for September, 2008

JavaScript compiler roundup

with one comment

I’m looking to start compiling JavaScript for a personal project, so I did a quick roundup of freely available JS compilers / obfuscators / minifiers.

Dojo Shrinksafe – http://dojotoolkit.org/docs/shrinksafe

YUI Compressor – http://www.julienlecomte.net/yuicompressor/

JavaScript Obfuscator by Stunnix – http://www.stunnix.com/prod/jo/

JSMin – http://www.crockford.com/javascript/jsmin.html

Packer- http://dean.edwards.name/packer/

So far I’ve tried Shrinksafe and YUI Compressor.  I couldn’t get Shrinksafe to produce any output, even though it seemed to be parsing my JS since it threw errors when I had something wrong.

YUI compressor ran on my input JS and produced output, but it had a couple of problems.  Backslash-escaped strings get unescaped from the output.  For instance,

alert("two \n lines");

Becomes:

alert("two
 lines");

Also, it seemed to have trouble with "else if (...) {" constructs, turning them into "else{if(...){".

Written by jsha

September 22nd, 2008 at 10:22 am

Posted in Uncategorized

Importing Evolution addressbook contacts into GMail

with one comment

GMail’s Contacts section now has support for a full-featured set of contacts, including phone numbers, addresses, etc.  I tried importing my addressbook from Evolution, but it wasn’t easy.  Step 1: Export your addressbook in vCard format.  Step 2: Tweak the output.GMail doesn’t like plain TEL records, it wants them to always beprefixed by phone., e.g.:phone.TEL;TYPE=CELL,OTHER:(510) 334-3594

Versus

TEL;TYPE=CELL,OTHER:(510) 555-1212Also GMail doesn’t like blank lines between vCard records.Here are a pair of vim commands to fix the above two problems::%s,^TEL,phone.TEL:v/./d

 

Once you’ve edited the file appropriately you should be able to import it using the Contacts > Import function within GMail.

Written by jsha

September 10th, 2008 at 2:48 pm

Posted in HOWTO