Sublime Text 2

Being a nerd is an odd thing. We’re really particular about things that never even occur to The Normals. Take, for example, text editors.

For a web developer or a writer well-verses in Markdown, selecting the right text editor for the task is a Very Important Thing. IDEs and GUI applications often get in the way of development, and Word is almost always overkill for writing plain text that’s ultimately just going to be copy and pasted into a text field in WordPress anyway.

iOS Editors

On iOS, there’s an embarrassment of riches when it comes to text editors. You want one that syncs to Dropbox and has Mardown editing features? You have 18 to choose from. Me? I alternate between Byword and Elements depending on the task, and have started using Drafts to quickly capture text that I later want to edit later.

Desktop Editors

Text Editors on the desktop are a different beast altogether. I use them for a lot more than writing prose — working with HTML, CSS, JavaScript, and scripting languages like PHP and Python are a daily occurrence. For a long time on the Mac there was TextMate, a highly customizable editor that became popular with web devs, but became stagnant after five years without a major update1. My copy never got much use since most of my work gets done on my work laptop and not the family iMac.

The text editor situation on Windows was bleak for a long time. Notepad++ was far better than the built-in Notepad, but was never something I felt like investing time into learning or looked forward to using.

I’ve even attempted to teach myself VIM on a yearly basis so I’ll know more than the basics, but haven’t been able to suffer through the learning curve to get to the point of proficiency.

And don’t get me started on Emacs. That thing is inscrutable.

Sublime Text

This brings us to Sublime Text. I can’t remember how exactly I first heard about it, but looking back through my email shows that I purchased my license for Sublime Text in March 2011, so I’ve been using it for at least 1 1/2 years at this point. It was a respectable version 1.x text editor, but even at the beginning, I was in it for the early beta version of Sublime Text 2. The final 2.0 version was released on Tuesday, and it is magnificent.

When you first open Sublime 2, it looks deceptively simple. Yes, it’s cross-platform2 and incredibly fast, but you don’t see much more than an empty screen where you can start typing text. But dig in, and you realize just how powerful of a tool this software is.

I’m not going to do a comprehensive review here, but I do want to run-down some of the notable features that makes this my favorite text editor.

Customization everything

The hundreds of settings and key bindings are both stored in simple json files that open right in Sublime Text. User files let you protect your customizations from any changes made to the Default file during upgrades.

You can also create macros, snippets, and auto-completions with similar configuration files — even on a per-file type or per-project basis.

Sublime Package Control

Sublime Package Control is a package manager you install into Sublime Text 2 that then lets you find, install, update, and remove other 3rd-party packages within the text editor. It makes adding new functionality super easy.

Minimap

The Minimap gives you a graphical representation of your entire file/document, allowing you to quickly “scrub” to the section you’re looking for.

Goto anything

Ctrl + P triggers the Goto box at the top of the window, which lets you open files, switch between files, jump to symbols or specific lines, or search.

Multi-selection

Multi-selection gives you multiple cursors on the page to very quickly make changes to multiple items.

Extensible via Python

Sublime Text 2 comes with a Python interpreter and console that let you extend the editor through the Python API. Python is a great scripting language and is very well-known, so expect many programmers to create wonderful extensions for Sublime Text.

Sublime Text 2 resources

Here are some good resources for learning how to use Sublime Text 2:


  1. A public alpha release of TextMate 2 was made available in December 2011, but a final version has yet to be announced. 
  2. Sublime Text 2 runs equally well on OS X, Windows, and Linux. 

Productive Email With Gmail

I’m a longtime Gmail user, but between my BlackBerry and the fact that I don’t get a ton of personal email, I’ve never spent a lot of time working in its web interface. That changed recently when I began piloting Google Apps Premier Edition for me and a couple of other colleague at work – a process I hope to write more about in a future post. But for now, I want to talk about the increase in productivity I’ve seen in the short time I’ve been using Gmail for work, as well as a promising new feature being rolled out today called Priority Inbox.

[Read more...]

Extensions vs Bookmarklets

I’ve been using Google Chrome since the first beta was released back in the fall of 2008, and it quickly became the default browser on my laptop. For over a year, speed and an uncluttered interface were its main selling points, as it lacked the one big thing Firefox had over it: extensions. The ability to customize and extend Firefox in ways unimagined by the Mozilla team has allowed it to become a powerful platform instead of simply a web browser. Then finally, last December, Google opened up its browser

The thing is, after using Chrome for a while, I realized that I didn’t really need – or miss – all those extensions I had collected in Firefox. Instead, I’ve found that since that I’m usually wanting to initial a search or take some sort of action on the page I’m viewing at the moment, simple bookmarklets are almost always Good Enough.1 These lightweight snippets of JavaScript sit out of the way in my Chrome bookmarks bar until needed, when each is just a click away from performing its specialized task. Best of all, since they’re just bookmarks, Chrome automatically syncs them across any Mac or PC I use.

Taking this obsession one or two steps further, I’m now experimenting with a web app called Quix that allows me to access all of my favorite bookmarklets from a sort-of command-line interface. When I need to take an action, I hit the Quix link in my bookmark bar and up pops a text prompt:

Quix Prompt

If I want to format the current page for easier reading, I can type read. To save the page for later viewing on InstaPaper, I type insta. If I’m looking at a page about a book and want to see if our local library has it available, I type odin. You get the idea.

Quix comes with a ton of commands already defined for you, covering a good 80% of what I need. The great thing is that I can define my own command file to override the default Quix commands or add my own custom ones. I’m hosting the text file as a gist on GitHub, so anyone is free to view and customize it for their own use.

There’s a lot to be said about simple solutions, and browser bookmarklets fit that description nicely.


  1. Google added extensions to Chrome late last year, and since then, the only two I use are LastPass and FlashBlock. Both offer functionality that isn’t easily duplicated using the bookmarklet model. 

Three Great Uses For Dropbox

Dropbox is one of my favorite little pieces of software. It’s practically invisible, silently keeping your dropbox folder synchronized on all the computers you have it installed on (Windows, Macintosh, or Linux). I can’t recommend it highly enough.

Because Dropbox is so easy to use, it’s easy to forget that it’s also very powerful. Here are two three advanced ways I’m using this great utility.

1. Secure Cross-Platform Password Sync

There are dozens, maybe hundreds, of pieces of software that will securely store passwords and other information you want to keep secret (credit card numbers, etc.). I stumbled upon what might be the simplest possible solution. 

Message Vault is a free/open source self-encrypting/decrypting archive written entirely in HTML and JavaScript. It’s a single HTML file encrypted with 128-bit AES encryption. You can keep it in your Dropbox folder and easily change your archive locally on your computer, plus you can view it on any computer with a web browser via the Dropbox web interface. It’s extremely secure if you choose a good password and requires no special software for viewing. It couldn’t be much easier.

Note: You could also use your Dropbox to sync a Trucrypt archive or a KeePass database file, but both require additional software to decrypt the contents inside.

2. Remotely Start BitTorrent Downloads

On occasion while at work I think of an audio or video file I’d like to download via BitTorrent. In order to take it easy on our office network though, I’ll start the download from my work computer and have our iMac at home do the real work. Here’s how that works.

The Mac OS BitTorrent client Transmission includes an option to have it watch a folder for new .torrent files and then automatically start downloading their content. That preference looks like this (it’s at the very bottom of the window):

Transmission watch folder option
If you wanted, you could simply set your watch folder to your Dropbox or one of its subfolders. Then, on the remote computer, you just download the .torrent file and drop it into your Dropbox. Within a few seconds, it will get synchronized with your other computer, which will then start the BitTorrent download as soon as Transmission sees the torrent file show up in the Dropbox folder.

I added an extra step in my workflow.  I’m a user of the rule-based Hazel utility that lets me trigger actions when certain events happen. In this case, I actually have my Transmission watch folder set to a subfolder of my Downloads folder for organizational. When a new torrent file shows up in my Dropbox, I have a Hazel rule that catches this action and automatically moves the file to the watch folder. Once this happens, I instantly get feedback on my remote computer, as Dropbox will inform me that the torrent file has been removed/deleted on both computers. This lets me know my download has started on the iMac.

Hazel Dropbox rule

3. Remotely Add Music to Your iTunes 9 Library

One of the least mentioned new features of iTunes 9 is the addition of a watched folder to allow you to automatically add music to your library. Add Dropbox and a Hazel rule and you’ve got the ability to update iTunes from another computer.

For this tip, I added a subfolder to my Dropbox simply called Music. This is where I move music files on the remote computer that I want added to iTunes library on my Macintosh.

Next, add your Dropbox Music folder to Hazel and create a rule called Move to iTunes that moves any music files found by Hazel to your iTunes watch folder, found at ~/Music/iTunes/iTunes Music/Automatically Add to iTunes/

That rule will look like this:

To test it out, drag one or more MP3 files into your Dropbox Music folder on your remote computer. Once the files have finished syncing, you should get notified that they have been deleted from the Dropbox. This means that Hazel has done its job and moved them out of Dropbox and into the iTunes watch folder. After that, it takes only a few seconds for the songs to appear in your iTunes library.

So, there you go – two three clever uses for your Dropbox. There are lots of other tips and tricks too, if you’re interested.

If you don’t have one yet, now’s a great time to signup for a free account.

Mobile Organization with Sandy and Jott

Since its release in May 2005, I had been using 37signals’ Backpack web application to keep track of pretty much anything I needed to remember. It worked well for awhile, but eventually became a burden. It became a dumping ground for everything in my head, and I began to dread logging into my account each and every day. This was obviously a bad sign.

The breaking point came in November when I got my new Blackberry smart phone. Here I was, with a great little computer and fast mobile internet access, but using Backpack on it was a huge pain. Yeah, I could send emails to my Backpack pages and have them show up as notes and to-dos, but there wasn’t an easy way to access my information from my phone. And, one of my favorite features of Backpack – email/sms notifications – offered no way to add these on the go. It felt like an information black hole.

So, I decided to turn to a several other web apps to fill the void. First, for the random info I gather and access frequently, I use Google Notebook. It offers a Firefox extension, iGoogle Gadget, and mobile version for easy and convenient access.

I want Sandy

Next, for any sort of to-do item I need to be reminded of, I use an awesome web app called Sandy. According to the site, Sandy acts as your personal email assistant. Just send an email or text message to a special email address known only by you, and the software will intelligently recognize dates, times, tags, and other keywords to create lists, reminders, notes, etc. For example, to add an item to your shopping list, you can send an email like this:

Remember to get milk and bananas @todo @shopping

This will add a new item, “get milk and bananas” to your to-do and shopping lists, which you can access on the go by sending a message like this:

@lookup @shopping

You can also have Sandy remind you of something on a certain date or at a certain time:

Remind me to pay the water bill on 2/5 @monthly.

This tells Sandy to send an email every month reminding you to pay the water bill, beginning February 5th.

There’s a lot of other stuff you can have Sandy do for you too, making it a very powerful way to manage your information, especially if you have mobile email access on a Blackberry or other smartphone. The big thing for me is that adding and retrieving my stuff from Sandy are equally easy, whether I’m at my computer, or just with my phone.

Jott Logo

As great as my Blackberry is, there are often situations where making an actual call is quicker and/or safer than typing out an email. Jott is made for exactly these cases. Once you setup your account, all you need to do is call their toll free number, and say who you want to “jott”. This could be “me” or “myself”, anyone you’ve added to your address book, or even our good friend Sandy, thanks to a feature called Jott Links. After the system makes sure it heard you correctly, it gives you up to 30 seconds to leave your message.

After you hang up, the magic begins. Word has it, Jott sends your voice message to medical transcriptionists in India, who will transcribe your words into text. Typically, this gets emailed to you or the recipient you picked. If you chose a Jott Link like Sandy, however, some even more amazing things happen. In the Sandy example, if you say “remind me oo call for a dentist appointmentat 10am tomorrow”, this gets translated to text and sent to your Sandy account, where it will automatically get created as a scheduled reminder. Jott Links are also available for Google Calendar, Twitter, Amazon, and other online services.

So, that’s my new mobile organization workflow. I love that I can send myself reminders and little notes the moment an idea pops into my head, and that I can easily access them from my phone or any computer. It works quite well for me, but admittedly, I’m not most people (I’m often reminded of this fact). I’d love to hear what works for you. Index cards? PDA? Something else?

How the Command Line Saved Me from 19 Hours of Tedious Work

At work the other day, I ran into a somewhat odd problem. I had a Windows server with nearly 3,000 folders, each containing a PDF file and an empty ZIP file, looking a little something like this:

2ec99d82-4b79-4454-9f4a-3b52c1cc63cc
|-- 2ec99d82-4b79-4454-9f4a-3b52c1cc63cc.zip
|-- 2ec99d82-4b79-4454-9f4a-3b52c1cc63cc.pdf

Sidenote: In case you’re curious, that long, weird looking string of numbers and letters is called a GUID (globally unique identifier).

The problem was that I needed to compress the PDF file into a ZIP archive, and then move it up one directory, for an end result of this:

2ec99d82-4b79-4454-9f4a-3b52c1cc63cc 
|-- 2ec99d82-4b79-4454-9f4a-3b52c1cc63cc.pdf 
2ec99d82-4b79-4454-9f4a-3b52c1cc63cc.zip

In this case, the why isn’t important. I had a ton of these PDFs I had to compress, one way or another. In situations like this, I do some quick mental math to figure out roughly how long it would take to do the job manually and weigh that against the time and effort of creating an automated solution. I did about 20 of these by hand, and from start to finish (including deleting the empty ZIP file, waiting for folders to refresh, and cutting and pasting the ZIP file), it took about 25 seconds:

25 seconds * 2900 = 72,500 seconds
72,500 seconds / (60 seconds / 1 minute) = 1,208 minutes
1,208 minutes / (60 minutes / 1 hour) = 20.14 hours

Here, it’s pretty obvious that an automated solution was in order, and would take a lot less time than to manually process these files.

Whenever you’re looking to automate something on a computer, command line (i.e., DOS prompt) utilities are your best friends. Linux and Unix are built on top of these types of specialized tools, and with a little effort, you can duplicate most of that power in Windows too.

My solution called for a ZIP utility could be run from DOS – a job filled nicely by my favorite open source file compression tool, 7-Zip. Next, I needed a way to run 7-Zip on each and every PDF file buried within their subdirectories, while ignoring anything else in those same subdirectories. Some quick research brought me to a Microsoft program called Forfiles that did exactly what I was looking for – iterate through a folder or directory tree and do something for each file it found.

To make things a little easier on myself, I copied all of the folders and their files from the server to a Windows XP machine, where I could experiment and work on my solution without the fear of screwing up the original versions. These all went into a folder called unzipped, while the compressed versions would go into – you guessed it – zipped.

After some tinkering for a total of about an hour over the course of two days, I ended up with this working command line script:

C:\>c:\forfiles.exe /P c:\unzipped /M *.pdf /S /C "cmd /c c:\7za a -tzip c:\zipped\@fname.zip @path"

There’s a lot going on in that single line, so I’ll break it down for you piece by piece:

C:> – Because I’m working with multiple programs and directories, I placed everything on the root of the hard drive to keep it simple and reduce confusion.

c:\forfiles.exe – This runs the Forfiles command line program.

/P c:\unzipped – Tells Forfiles the folder path where it should start working

/M *.pdf – Specifies that it should only worry about files that end in a .PDF file extension.

/S – Indicates that it should also look for PDF files within subdirectories of c:\unzipped.

/C – Tells Forfiles to execute the command immediately following and within quotes.

cmd /c – Launches another command prompt specifically for use by the next program.

c:\7za – Kicks off the command line version of 7-Zip.

a – Tells 7-Zip to create an archive file.

-tzip – Indicates that the type of the archive file should be the ZIP format.

c:\zipped\@fname.zip – The ultimate location of the resulting ZIP file. Note that here, @fname is a variable from Forfiles that returns the name of the file it’s working on, minus the file extension.

@path – The full file path of the PDF file that should be zipped. This is also a Forfiles variable.

So, there you have it. It took less than seven minutes for this little script to find and compress all 2,900 PDF files I had. Not bad, considering it would have taken me half of my work week.

Getting Things Done with Backpack, SMS, and Google’s Apps

I have to admit: I love the Getting Things Done productivity system, but I’m not very good at sticking with it. At some point in the process, I forget about the single, trusted place to put down all of the “stuff” in my head (ideas, to-dos, etc.) and end up with multiple dumping spots. Random index cards at home, at the office, some things in my work email, some in my Gmail account, some on my white board – it gets bad. Bad enough that I can’t really trust my lists anymore, because I just might be forgetting something somewhere.

This past week, I finally said “enough”. I managed to get trust back into my system by consolidating everything back into my Backpack and Google Calendar accounts. Any event that happens at a specific date and time goes into my calendar. Everything else goes into a Backpack page for a specific project or topic. If I need to remind myself of an appointment or to do anything else, both Gcal and Backpack can send me email and text messages when I want.

The real benefit since reorganizing has been in getting stuff into my system. Each Backpack page has a unique secret email address that can receive info from my email (Gmail) or from a text message from my phone. This functionality has been there all along, but I didn’t take advantage of it until recently.

If I need to capture an idea, but I’m doing something where I’m not at a computer or can’t type on my phone’s keypad (while driving, for example), I can call up a CellTell phone number and leave myself a voice note. A few minutes later, it shows up on my Backpack home page where I can play it back and make a longterm decision of how to deal with it.

Having all of my opened items and commitments in one spot has been a load off my mind. If you struggle to track all of your to-dos, ideas, and appointments, my might want to take a look at doing something similar.

My Favorite Firefox Extensions

One of my friends recently asked me what I’m using for extensions in Firefox 2, then suggested I share my list with the world. So, that’s exactly what I’m doing here. I’ll split them up by category so you can find the ones that apply to you.

Improving the Firefox Interface

Even though Firefox is amazing out of the box (or, more accurately, after the download), I use a few extensions to fill in some gaps.

Adblock Plus

Adblock Plus blocks so many web ads, it’s really tough browsing on a computer where it’s not installed. It comes with a set of filter subscriptions that will automatically stay up-to-date so you only have to see the ads you really want to. Highly recommended.

Download Statusbar

Firefox’s default download manager annoys the heck out of me, but Download Statusbar fixes this. Just as its title says, it displays a download status bar at the bottom of the browser window to let you know when your files are completely retrieved.

Tab Mix Plus

I’m a huge fan of tabbed browsing, so I appreciate the extras offered by the Tab Mix Plus extension. Among other things, it color codes unread tabs, gives you the download status for each one, and lets you lock and protect tabs so you won’t close them accidentally.

Fission

One of the nice little touches I appreciate in Apple’s Safari browser is the address bar that doubles as a progress indicator. The Fission extension’s only job is to add this feature to Firefox, and it does it well.

ErrorZilla

ErrorZilla replaces the default Firefox error page with a set of options, including going to a Coral Cache version of the page (if it’s available), visiting the Wayback Machine, or doing a trace route or ping to see if the web server is down. It comes in handy every so often.

Power Tools

Here are some other extensions that don’t fit into the above category:

Greasemonkey

Greasemonkey is a little hard to describe. It lets you create little scripts that can modify pretty much any webpage right before it’s rendered in Firefox. You don’t have to actually write scripts yourself (there are tons available for download), though there’s a good guide available for free in case you get adventurous.

One of my favorite user scripts is one that creates a “smart” subscribe subscribe button for every page that has an RSS feed. If I’m already subscribed to that feed in Google Reader, it displays a little check mark letting me know I’ve already got it. A nice feature, especially when you have a couple of hundred subscriptions.

iMacros for Firefox

To be honest, I have the iMacros extension installed, but haven’t done much with it yet. I like the idea a lot though. It lets you write macros for a web page that automate repetitive tasks.

PwdHash

PwdHash makes it easy to create site-specific passwords, giving you a higher level of security than if you just use a single password everyone.

Operator

Operator exposes Microformats present on pages and makes it easy to work with them. A little handy now, but Firefox 3 will probably have this sort of functionality built right in.

Attention

Attention Recorder

Right up front, I admit this one is pretty geeky. There’s a small movement going on right now advocating the ownership of your personal attention data made as you use the web. I’ll write more about this at some point in the future.

For now though, Attention Recorder captures your clickstream and browsing history in a file on your computer which you can do whatever you want with. You can also choose to upload this same data to a trusted 3rd party such as Root Vault for storage and analysis.

del.icio.us extension

I’ve been storing my bookmarks and links of interest to my del.icio.us account for almost two years now instead of saving them in Firefox. Not only are they now easier to search and available from any computer, there’s also the side benefit of sharing them with everyone else. I’m just that nice of a guy!

The del.icio.us extension makes it really easy to tag and save pages as you browse, and gives you quick access to your account when you need it.

Web Development

As you probably know, I’ve been big into web design and development for a while now. There are some awesome tools available for Firefox that makes the process easier. Here are some of my favorites.

Firebug

Firebug is unbelievable. This tool has become invaluable in debugging CSS and JavaScript. You can easily see how styles cascade (or don’t) across your HTML elements and edit them on the fly to see how things look in the browser. It can also debug AJAX requests, something that has personally helped me in my Ruby on Rails projects.

If you do any sort of web design or programming, do yourself a favor and download Firebug. It’s free, but it’s one extension I’d actually pay money for.

Web Developer

I’ve been using the Web Developer extension since 2004, and it has become an indispensable part of my web design toolkit. Some of its functionality is duplicated by Firebug, but there’s still a ton of other features there, including a “view generated source” option, which lets you view the HTML as it’s currently displayed in the browser window. This is one of those things that come in really handy when debugging AJAX and JavaScript that modify the Document Object Model after the page is actually downloaded from the server.

Html Validator

I’ve become used to regularly validating my HTML documents during development, and the Html Validator extension makes this process automatic. Instead of manually going out to the W3C validator service, this extension will do the validation locally on your computer right after the page is rendered in Firefox. This can save a lot of time over the course of your project.

I’ll make one small note on this extension: I have run into some cases where this extension says a page has valid markup, but where the official validator picks out some problems. Even so, it’s still a good first line defense.

Live HTTP Headers

Useful mainly when doing web development/programming, Live HTTP Headers lets you take a peek at the conversation going on between your computer and the web servers it gets content from. You probably won’t use it on a daily basis, but it comes in handy in special cases.

Professor X

Professor X lets you take a look at the content of a page’s “head” section without viewing the source. Nothing earth shattering here, but still a nice option to have.

SEO For Firefox

The SEO For Firefox extension adds a bunch of search engine optimization links and resources that’ll give you better insight into a page’s search rankings, along with a bunch of other useful info.

Well, there you go. I hope you found one or two tools that can help you out. If you’ve got a favorite extension, please let me know about it in the comments.

The Procrastinator’s Clock

Last week David Seah released the Procrastinator’s Clock, a simple clock that runs somewhere between on time and 15 minutes ahead. If you’re the type of person to set your clock 10 minutes ahead, then build that buffer into your plans anyway, it might be worth a look.

The Procrastinator's Clock

Besides being fun, the Procrastinator’s Clock reminds me of a somewhat similar idea I had a year or two ago. Mine was for an alarm clock that would go off randomly some time between on time and an hour early. I still haven’t tried building it yet though…

Quicksilver

Today I downloaded and installed Quicksilver on my PowerMac at work after about a week of curiousity. I first read about it on 43 Folders (one of my favorite new sites), which offers a bunch of “life hacks” with the aim of becoming more productive in work and life.

I have to admit that I really didn’t understand what Quicksilver did when I downloaded it. I had a vague idea that it is a productivity tool and is considered a “launcher”, but that was about it. After a few minutes of using it though, the light bulb finally flickered on. I haven’t used it very much yet but can see what all the fuss is about. From looking at some of the posts on 43 folders about Quicksilver, I haven’t even scratched the surface yet.

It’s definately worth a download if you’re a Mac user! Quicksilver is free, and if you like it you can send the auther a donation to show your appreciation.