Quickly Open the Current Tmuxinator Project

I got tired of manually typing the name of Tmuxinator projects every time I opened a folder, so I made a quick mux function that opens, edits, or deletes the Tmuxinator project named after the current folder.

It’s not the smartest function—it won’t work great if your folders are named the same—but hopefully it helps you out anyway.

function mux() {
  project=$(pwd | xargs basename)

  if [ "$*" = "" ]; then
    tmuxinator start "$project"
  elif [ "$*" = "edit" ]; then
    tmuxinator edit "$project"
  elif [ "$*" = "delete" ]; then
    tmuxinator delete "$project"
    tmuxinator "$*"


  • mux — starts the project
  • mux edit — creates/edits the project
  • mux delete — deletes the project

All other commands fall through to Tmuxinator.

UIRefreshControl Can Interrupt Scrolling

While implementing infinite scrolling in Get Seated, I ran into a strange side-effect of calling endRefreshing() on a UIRefreshControl that isn’t animating: if the user is scrolling the view, any velocity from the user’s “flick” will be lost and the view will immediately stop scrolling.

It’s easy to hit this glitch if you call endRefreshing() every time new data finishes downloading from your server. Thankfully, UIRefreshControl has a property to detect if it’s currently refreshing. Just verify it returns true before you try to end refreshing.

Swift 3

if self.refreshControl?.isRefreshing == true {

Swift 2

if self.refreshControl?.refreshing == true {

Experiencing Productivity

Shawn Blanc:

Is the stay-at-home dad who spends most of his day changing diapers and cleaning up messes any less productive than his wife who is the CEO of a charity organization?

Sometimes I feel the most productive when I’m doing non-work errands. If you’re trying to break a cycle of non-productivity, don’t forget there are plenty of productive things you can do that may not be directly related to your occupation.

Doing simple household chores can be a great warm-up to addressing bigger challenges. If that’s what gives you motivation and confidence, don’t feel guilty.

How to Create a Hotkey That Selects the Current Word (OS X)

One of my favorite features in Sublime Text is the Cmd+D keyboard shortcut that selects the word nearest to your text cursor. Multiple presses select other instances of the word allowing you to edit them simultaneously, but I mostly use it to select the word I just typed.1 A similarly helpful feature has come to the iPad and iPhone 6S in iOS 9.2

Since most of my day is spent in Sublime Text, pressing Cmd+D quickly made its way into my muscle memory, and I started attempting to use it in other programs to no avail. A little bit of searching led me to the discovery that OS X has a similar feature built-in, but it’s not easily assigned to a hotkey.

You’ll need to create ~/Library/Keybindings/DefaultKeyBinding.dict and add the following lines to it, then restart any open applications you want to use the hotkey in:

  // ^ for Control, ~ for Option, $ for Shift, @ for Command
  "^w" = (selectWord:);

The example above uses Ctrl+W, but you can customize it to your liking. For instance, swapping ^w for @d would match Sublime Text’s key combination.3

Any application that uses native text fields will now allow you to quickly select the current word. Have fun editing!

  1. If you’re interested in editing every instance of the current word, there’s a better way: Cmd+Ctrl+G

  2. iPad: Tap the keyboard with two fingers.
    iPhone 6S: Press down hard on the keyboard. 

  3. Be careful. Unfortunately Cmd+D is set to other actions in a lot of applications, and this won’t override it. For instance, Safari uses it to create a bookmark. You might want to pick something else. 

Zsh PATH Issues in OS X 10.11, El Capitan

I immediately ran into problems with my PATH after upgrading to El Capitan. Instead of using my custom version of Ruby, El Capitan was using the system version. It was easy to spot why: OS X was reordering $PATH.

If you’re having the same problem, I suspect we have similar setups: I set $PATH in ~/.zshenv so Pow and GoSublime have access to it; I configure aliases and functions in ~/.zshrc since it’s more efficient to only load them for interactive sessions.

As it happens, El Capitan introduced a global Zsh profile at /etc/zprofile that calls /usr/libexec/path_helper, a utility which adds system directories to $PATH, reorders it, and then removes duplicates.1 Our customizations are being overwritten because Zsh calls /etc/zprofile after ~/.zshenv.

Solution 1: Disable Loading Global Profiles

If you don’t want to load /etc/zprofile or other global settings, there’s a command to disable them. All you do is add this line somewhere in your ~/.zshenv file:

setopt no_global_rcs

There are two things to be aware of with this fix although I find it highly unlike either will affect you:

  1. Future OS versions may modify these files with changes you need.
  2. If you’re on a multiuser system, your system administrator could be using the global files to configure settings and functions related to your job.

Since I find it unlikely OS X will change these files and since I am my own system administrator, this is the solution I’ve personally enacted.

Solution 2: Don’t Set $PATH in Zshenv

The biggest reason I set my PATH in zshenv is so Pow and GoSublime will have access to it, but most programs have multiple ways to set their search locations. For instance, Pow checks ~/.powconfig for exported variables. Likewise, GoSublime has a settings file where you can set $PATH and $GOPATH. Just move your PATH setup to ~/.zshrc or ~/.zprofile and configure your tools using their custom methods.

For instance, a Pow config for use with rbenv might look like this:

export PATH=/Users/$(whoami)/.rbenv/shims:$PATH

The downside is you will need to update multiple files if you ever change your Ruby, Go, or similar setup.

  1. OS X has always done this for Bash (in /etc/profile) and Csh (in /etc/csh.login). While an annoying change, it appears to have been made for consistency. 

A Fix for Safari Forgetting Your History

For the last few months, Safari would forget bits of my browsing history every time I closed it. After around 24 hours only one or two items would be left listed for the previous day of browsing. There was no logic to what was being remembered or how quickly history items would disappear.

I upgraded from OS X 10.10 (Yosemite) to 10.11 (El Capitan); I disabled all my Safari extensions; I cleared out the cache, cookies, and the few items left in History; I turned off syncing Safari to iCloud in System Preferences; I closed every application and background process I found running; I checked to make sure that “remove history items” wasn’t set to “after one day”1 and I even changed it to “manually” to see if there was a bug. Nothing worked.

Screenshot of Safari 9.0 Settings

If you’re here it probably means googling hasn’t been helpful: most search results are for people who want to disable history tracking. I feel your pain, but hopefully you’re in luck.


My problem stemmed from a corrupted database in ~/Library/Safari/. There are five files in that folder related to storing your history. You should close Safari and then delete all of them: History.db, History.db-lock, History.db-shm, History.db-wal, and

Contents of ~/Library/Safari/

With any luck, you should now be able to open Safari, load a website, and then close Safari without it losing your history.

  1. This was officially the most common suggestion, and it started to become infuriating. That said: go check it just to be safe. It’s the most common for a reason. 

  2. The easiest way to open that folder is:

    1. Open Finder
    2. Press Cmd+Shift+G
    3. Type ~/Library/Safari/
    4. Press Go

Standing Still

There is nothing inherently wrong with nostalgia or tradition, but there’s a point where it can go dreadfully wrong, where we can get trapped in it. Our past starts to clutter our present. Eventually we reach a point where we can’t move forward with our lives because we’re too afraid of upsetting the past.

Life is one big, grand experiment. It’s also short. We’re doing ourselves and humanity a disservice by pushing the status quo.

Where we go next may not necessarily be better or worse than where we are now, but sometimes you have to move on anyway. If we don’t push forward, constantly testing and expanding our limits, we risk stagnating.

No great period in history ever got started by standing still.


When asked how they capture such stunning photos, professional photographers tell the same story: film is cheap. Take a lot of photos with the understanding that you’ll throw almost all of them away. For every masterpiece you see, there were hundreds of photos that weren’t good enough, but it’s better to waste some film than to miss a once-in-a-lifetime opportunity.

Your opportunity could be right around the corner—you could be on the verge of creating a masterpiece—but only if you keep trying.

Don’t give up. Life is too short to worry about the obstacles in your way.

The State of Music Streaming Services

With Apple’s developer conference kicking off tomorrow and rumors swirling about a new Apple music service, I thought now would be a good time to finally write up my thoughts on the current state of music streaming services.

(Disclaimer: I do not attempt to extensively cover music streaming services. I only discuss a few specific features—or lack of features—in Spotify and Rdio that bug me, with some postulations about how Apple’s service might improve them. That said, I did try to pick things I hadn’t heard other people talk about before.)

Bring Your Own Music

It’s imperative that users have a way to easily play songs they’ve bought elsewhere; no matter how hard music companies try to sign-up artists, there will always be some that aren’t on their service—artists like Taylor Swift, who pulled her albums from Spotify last year.

While Spotify lets you add local audio files to your library and sync them to your devices, the files are exiled to their own section of the app. If you like curating playlists manually, you’ll love Spotify: that’s the only way you can listen to a contiguous mix of streamed music and local audio tracks. You can forget about plugging in your headphones and just pressing shuffle.

Sadly, the Spotify experience is still better than Rdio, which doesn’t offer any way to play local files. Like some indie songs that aren’t on Rdio? Get ready to swap back-and-forth between music apps.

If there’s one thing I expect Apple to get correct, it’s this. In fact, that’s what we already see happening with iTunes Match: if a local song can’t be matched with one on their server, your copy gets uploaded and then synced to all your devices, and it shows like normal alongside all your iTunes Store purchases. I don’t expect any of this to change as Apple begins their foray into music streaming.

Importing Your Existing Library

If streaming services would let you bring your own music, importing your existing library wouldn’t be necessary, but we’ve already seen how well that works.

In a past life, Spotify let you drag songs it recognized from your “Local Files” view to your Spotify library, but it won’t let you anymore. The artist name and album title of recognized songs are clickable within the Local Files view, but there’s no easy way to add them to your library. Your options are to load each album page and manually save them, or you can use a third-party service that’s likely to break.1

Rdio does have a way to automatically add songs from your iTunes library to your Rdio library. It’s not perfect (some songs aren’t matched even though they’re on Rdio), but adding a handful of leftover songs is easier than manually importing an entire library worth.

Again, iTunes Match already handles this. You can easily important any DRM-free audio files you want. It’s not always perfect when matching songs, but that’s a non-issue since unmatched files get uploaded and synced to all your devices anyway.

Playlists, Radio, and Moods

I think a lot of people still discover new artists and songs through radio and radio-like sources, but that’s completely anecdotal. Sure, you can follow artists you already know on social networks, or your friends may post links to songs they love, but what if your friends share a different taste in music?

Trusting someone else to filter the bad songs for you is relaxing. When I listen to music, I want to hear a mix of current songs I love, older songs I love, and new songs I haven’t heard before. This is where playlists and radio stations shine, and I’m not the only one who thinks so: Spotify added playlists handpicked by experts a few years ago and just recently announced Spotify Running, a feature that picks songs based on their tempo and your running speed; Beats Music built their entire business around curated playlists, and Apple thought it was such a good idea that they decided to acquire Beats Music last year.

This is, thankfully, the one thing that almost every music streaming service gets correct, although Pandora has a tendency to tilt too heavily toward older songs. Almost all streaming music services seem to believe that discovery is one of the most important things they can provide, or else there’s really nothing separating them from their competitors, and nothing keeping you interested enough to come back.

Spotify has recently stated they believe music genres are dying and that most people will start listening based on the mood of the music rather than the genre. It’s certainly an interesting proposition. I’ve been in dilemmas where an artist like Adelle would surface during the middle of a happy mix of songs. I love Adelle—she has an amazing voice—but I don’t want to hear a breakup song while I’m tired and driving in traffic; I want to hear breakup songs when I’m coming off a bad relationship, but I don’t want to make a playlist called “Music For When I’ve Been Dumped” and another playlist for songs I like when I haven’t recently been dumped.

This is the area I am most excited about as I watch Spotify and Beats battle it out for dominance in the playlist field.2 I’m very interested to see how good curated playlists are at Apple’s scale. I have nothing against Spotify’s playlists and radio stations, but they’re not perfect. iTunes Radio feels about the same right now whenever it works: there’s a bug where liking/disliking too many songs will result in a station being perpetually “Unavailable.”

Radio Edits, and Songs in Multiple Albums

Two thing that none of these services get correct is radio edits and songs that can be found in multiple albums. iTunes tries to tell you if you’ve bought a song already, even if it’s from another album, but only in the iTunes app; iTunes Radio for iOS, Mac, and AppleTV don’t recognize if you already own a song unless it’s exactly the song and album you purchased it from.

Buy it from another album? Purchase it from somewhere like Amazon? Even if it’s recognized by iTunes Match, iTunes Radio will try to sell you the song all over again.

If you think Spotify and Rdio are in the clear, think again. The same thing happens if you’re listening to a song on one of their playlists or radio stations. I have accidentally added a song to my library multiple times because it couldn’t tell I had already saved that song from a different album.

Which brings me around to radio edits: where’s the option to prefer radio/full edits of songs? I’ve also accidentally added both a radio and full edit of a song to my library, which all three services will occasionally play back-to-back just to screw with me. Remixes share a similar problem.

Across the board, all services fall flat in this area. I’d love to see some improvements.

  1. At publishing, Unify’s website displayed this message: “Unify is no longer compatible with the current version of Spotify. We’re working on an update. Please come back soon.” 

  2. Pandora, I think, has stagnated: their algorithms have not gotten better at detecting what I enjoy, and they have a huge tendency to resurface tired, old songs. Likewise, I haven’t heard any new movement from Rdio in this area. 

Apple Watch: Third-Party Complications

There are two ways the Apple Watch can convey information: it can “push” information to you when it thinks you’ll need it, or you can seek out and “pull” information when you want it. Of the two methods, it’s quicker for the Watch to push you information, but what happens when it can’t read your mind?

What if you could preemptively tell it 3–4 pieces of information you need most, so it can display them every time you lift your wrist?

Consider the attention hierarchy laid out by Horace Dediu:

The Apple Watch offers a hierarchy of surfaces onto which software can compete for attention:

  1. The Complication Layer
  2. The Notification Layer
  3. The Glances Layer
  4. The App Screen

These surfaces are arranged in a hierarchy where the highest is the most accessible and the lowest is the least accessible.

It’s safe to say that Apple is investing efforts in smarter notifications, à la Google Now, but complications will always be the quickest way to pull information from the Watch since they don’t require you to touch the screen.1

If Apple’s goal is to make your experience with the Watch as quick as possible, to help you grab information in a matter of seconds instead of minutes, then allowing third-party apps to make complications is an appealing solution. I have a suspicion we’ll eventually see them.

  1. Ben Thompson expounds upon this idea, adding Siri to the mix. But no matter how fast Siri responds, you always have the delay of talking to it—at least until computers can literally read our minds.