Decode quoted-printable text with Sublime Text or Textmate command

If your like me you find yourself frequently need to take an HTML email that you received and alter it or clean it up and then send it out again. When you grab the message source what you discover is an ugly block of HTML-like text. It’s full or things like “=3D” or “=20”, don’t worry. This strange text your seeing is the result the HTML being encoded into the quoted-printable format. This encoding is how email keeps it’s lines at the appropriate length to be compatible with all the various email servers.

This command which can be used in either E-TextEditor or TextMate will decode the quote-printable encoding. It operated on either your current selection or the whole document. Internally the command itself uses Python to decode the quoted-printable text.

Download the quoted-printable decoder Sublime Text command
Download the quoted-printable decoder E-TextEditor / TextMate command

Automatically Format Any Javascript Code

Every javascript programmer at somepoint finds themself in a situation where they need to undo the effects of a packer or minifier on their code. Javascript Beautifier to the rescue.

Javascript Beautifier

It lets you cleanup the super scrunched up code into something more readable. This enables you to recover your source files if you lost your originals or dig through someone elses code and get a better idea of how other people in the real world are coding.

Passpack + Chrome = Frustration

Everyday I log into Passpack and leave it open all day. So here’s the problem after having Passpack open for a while I get the following message (it is extremely annoying as it interupts whatever else your up to on the net). This only happens for me in Chrome. It works like butter in Firefox and I can’t speak for IE.

Passpack History Problem

The initial trigger for the message seems to be random. But after it initial message is seems to come back around every 3 minutes. So I did some digging. After poking around in the source I discovered that they’re using an older version of Tako Sano’s jQuery history plugin.

So I added some code to the historyCallback do some logging so I could get a better feel for what was going on.

After letting this run for a while I started to see a pattern. Here’s an excerpt of the results.

  • hh: 8, m: 7, delta: 209901 (~3.4 minutes)
  • hh: 8, m: 7, delta: 200888 (~3.3 minutes)
  • hh: 8, m: 7, delta: 190944 (~3.2 minutes)
  • hh: 8, m: 7, delta: 183514 (~3.0 minutes)
  • hh: 8, m: 7, delta: 197517 (~3.3 minutes)

For webkit (Chrome/Safari) based browsers the jQuery history plugin manually creates a stack to keep track of the history. So this is where I believe we are encountering the problem. If you look at line 4426 you can see that we create a history with a stack length of 9.

But on line 4419 we are working with a stack with a length of 8.

var m = $.browser.netscape ? 2 : $.browser.msie ? 3 : 7;

Shouldn’t this read as follows?

var m = $.browser.netscape ? 2 : $.browser.msie ? 4 : 8;

Bypass OpenDNS Blocked Sites At Work

So your at work and you really want to watch that YouTube video your buddy sent you. But you can’t cuz YouTube is blocked. Well I’m here to show you how. This builds on a previous post I did about listening to¬†Pandora in Canada. Your using the socks proxy we setup before but you still can’t watch YouTube clips because their being blocked at the DNS level. Nothing we can do about that right? Wrong. Lets configure Firefox to send DNS requests over the socks proxy. There by circumventing the DNS blocks at work.

Firefox - about:config

In Firefox type about:config into the address bar. Now type dns into the filter. Double-click on the network.proxy.socks_remote_dns to configure Firefox to send our DNS requests through the proxy. Voila! We can now laugh it up watching YouTube clips to our hearts content.