Sublime Text 3 Packages

Since I recently switched from VIM back to Sublime Text 3, I thought I’d share some of the packages that I’m using.

While Sublime Text 3 is still in beta, it seems to be stable enough to use. That being said, many of the packages have limited or no support for Python 3 at this point, which is necessary for ST3. Some of the more popular packages have branches on GitHub dedicated to Sublime Text 3 support. You can install those packages through Package Control by first adding the URL associated with that branch as a repository. For example, “https://github.com/weslly/Nettuts-Fetch/tree/st3”.

First, since I came from VIM, I thought it would be nice to use Vintage. I’ve used Vintage in the past and haven’t necessarily loved it though. Luckily, while I was searching for other packages that have Sublime Text 3 support, I stumbled upon Vintageous which has been excellent so far. At this point it’s kind of the reason that I don’t want to go back to Sublime Text 2.

Package Control

I was very happy to find that Package Control works in ST3. There are special installation instructions that involve manually cloning the repository, but nothing too complicated. After the initial install process, everything seems to work like normal.

Theme

Since the theme and color definitions aren’t dependent on a particular version of Python, the old themes and color schemes should still work. As always, I’m using the Soda theme with the Tomorrow Night color scheme. For now, I’m using the Tomorrow Night Eighties variant because it’s so hipster. ;)

Languages

Like the themes, language definitions aren’t dependent on a particular version of Python. The additional language definitions I’ve installed are CoffeeScript and Sass.

Other

Lastly, I’m using a few other utility packages that just make life easier.

  • GitGutter: I used something similar to this in VIM and I couldn’t imagine life without it. Basically, it tells you what changes have been made to the current file since the last commit.
  • Alignment: The standard version of this one doesn’t work, so you’ll have to find a working fork. I’m using https://github.com/kevinsperrine/sublime_alignment/tree/python3 and it works so far. This one lines up stuff in your code. I primarily use it on long lists of variable definitions or similar blocks so that all the equals symbols line up, making the code easier to read.
  • Fetch: Another package that needs the correct branch to be manually added to package control at this point. https://github.com/weslly/Nettuts-Fetch/tree/st3 is what I’m using. Since it’s made by Nettuts, I’ll let them explain in their article, Introducing Nettuts+ Fetch.
  • SublimeLinter: While SublimeLinter theoretically works with ST3, I haven’t been able to use it so far. Even though I normally don’t have an issue missing semicolons and such, it’s nice to have a linter watching your code so you don’t waste time tracking down bugs based on syntax errors.

WordCamp Milwaukee 2013

I’ll be at WordCamp Milwaukee this year talking about some of the things I do to ease the process of developing WordPress plugins and themes. Computers are really good at following instructions and carrying out repetitive tasks, so we should use that to our advantage and automate away the “setup”, which will allow us to focus on the task at hand — creating the next hit plugin or theme.

I’ve been to WordCamps in the past and it’s always a good chance to meet other people who use and develop for WordPress on a daily basis. So whether you’re a developer that’s been using it for years or someone who is just thinking about starting your first WordPress blog, WordCamp Milwaukee will have something for everyone. As you may know, the WordPress community is filled with people that want to help and this is your opportunity to talk to them face to face.

If you decide to go, you can use the coupon code “betz” to save $5 at checkout.

Why I’m Switching Back To Firefox 

Not me, I still use a combination of Safari and Chrome Canary.

Firefox greets me with a page explaining my rights as a user of open source software. Chrome greets me with… sigh… Chrome greets me with a fucking advertisement for a Chromebook.

It’s an interesting article though.

Why I like DST 

Dr. Drang wrote about daylight savings time and why people who say it’s bad are wrong.

I too like daylight savings time. Or, basically anything that allows me to see more sun during the day. After dealing with sunsets at 4:30 – 5pm all winter, I’m ready for longer days again. And not the kind of longer days that start at 3:45am.

P2 Theme

After trying to sort out the best way to facilitate asynchronous communication for a group project, I was reminded of P2. This talk by Pete Davies at WordCamp SF this past year tells a very compelling story about why you should use P2 on your project. You can use it for free on WordPress.com or download it to run on hosted WordPress. It took all of a few minutes to sign up for a free WordPress.com site and switch to the P2 theme. After that it was all work.

Secure Shared Files with Hazel

Occasionally I need to send sensitive files to someone on the internet. I took a tip I once heard from Merlin Mann and built a script to automate this as much as possible. It requires Hazel and a cloud sharing service that syncs to your Mac. I’m using Dropbox.

The basic idea is to use Dropbox as a place to share files safely and automate the process with Hazel. We’re going to rely on long, obscure filenames along with randomly generated passwords and short availability windows to protoct our files. We can automate all of this through a couple Hazel commands and an Applescript.

The Hazel commands are set up as follows. The first one looks for any file or folder older than 7 days that is a zip archive and deletes it. This enforces our short availability window. You could make the window anything you like. The second command looks for anything that’s not a zip archive and runs the following Applescript on it.

We generate a random password with openssl rand -base64 32 — this means we’ll get 32 random base64 characters. We also create a SHA1 hash of the file to append to the filename. After that, just zip the file with the random password and put the password on the clipboard. You can do more, like generating a notification when the script is done. I have a TextExander snippet that lets you fill in the filename and grabs the password off the clipboard.

Ideally, you wouldn’t send the password along with the link to document. Try to use two different methods to notify someone where the file is located and what the password is — even if it’s just two different email accounts on a separate server.

For now this won’t work with directories because the SHA1 hash of a directory is blank. An easy way to fix that would be to zip the directory first and then get the hash and rename the zip file.

Listless Nav Menu in WordPress

Chris Coyier recently posted an article about using lists in navgiation on CSS Tricks. I tend to agree that they’re unnecessary. The first time I built a menu with a nav wrapping a ul wrapping a bunch of li’s wrapping a bunch of a’s it felt gross, but I did it because I thought that was easier for screen readers to understand.

I just redesigned my site and decided that I wanted a simpler structure for my menu this time. Since WordPress builds menus in lists, I created a custom walker class for wp_nav_menu that formats the menu the way I want.

That looks like a lot. It’s mostly just a copy of the Walker_Nav_Menu class with a few things changed:

  • Change the default container to ”
  • Change the default wrapping element to nav instead of ul
  • Disable a fallback1
  • Change the sub-menu element to div instead of ul
  • Remove the li wrapping each link
  • Put the id and class’s that would normally go on the li on the a instead.

Of course, you have to tell your nav menu to use this walker. Since this disables the fallback if you don’t have a menu set, you’ll have to specify a menu.


  1. Unfortunately the fallbacks generally aren’t compatible with custom walkers — at least not the same custom walker that can be used for wp_nav_menu 

Webkit Animation Performance

Paul Irish explains when translate() is better than top/right/bottom/left. I think the most interesting part of this is how he uses the tools in Chrome to diagnose the problem.