Welcome to the lab.

As a developer, it’s incredibly frustrating when a client swoops in at the last minute and asks for one more thing. Do you know how much time you’re spending on every feature, tweak, or bug fix?

Harvest is a time tracking tool built for understanding where your time is going. And for developers, it takes the pain out of time tracking. You can start a timer from pull requests or issues in GitHub or JIRA without searching for your timesheet.

Not only will you understand how much time you’re spending on client work, you’ll be able to turn billable hours into an invoice from Harvest in minutes. Harvest integrates with PayPal and Stripe to make it easy to get paid.

Instantly create hosted, shareable pages from selected Markdown with a keyboard shortcut on OS X. It’s handy for use with Twitter and other social platforms, as well as with Slack and general collaboration tools.

This elegant piece stands out because horizontal orientation is going to be important after the next WatchOS update. I’ve been planning a wood version of something similar to go along with the Shuttle. Speaking of…

From Steven Degutis, creator of the choose utility and other goodies I’ve mentioned before. music is a command line, JSON-based music player for OS X, perfect for integration into scripts. A GUI is planned for the future.

There are a lot of catchy clichés describing how optimism is the light of the world, and how pessimism is evil creeping into your thinking. Seeing a glass as half empty, though, is not a negative outlook. It’s a realistic assessment of a limited resource.

I’m an incorrigible optimist. It’s served me well, for the most part. I’m always willing to take a gamble, and I’m usually satisfied with the outcome. When deciding to go indie, I did my best to tally up my potential sources of income, marking both the highest and lowest possibilities to weigh the options. Thus far I’ve hit a fair medium. I have projects in the work that I forecast will make things even better, and I’ve staked a lot of my time into bringing them to fruition. A lot of my time at the expense of more immediately fruitful pursuits.

My wife is what I think most of the clichés would deem a pessimist. I wouldn’t be able to do what I do without her. For every wild idea I plan out, she reminds me of the realistic outcomes, backed with historical data. If it weren’t for the tempering quality of having “pessimists” around, I’d be living in a tiny apartment, buried in debt, and likely friendless. I prefer to think of them as realists.

If a glass is half full, you’re celebrating the abundance of what the glass still contains, which leads to a more carefree approach to savoring the remaining contents. If you see it as half empty, you might savor it even more, being conscious of the fact that no matter how much is left, it’s less than you started with. I sometimes envy that realistic view.

I like being an optimist, but I take a guarded stance on the matter. When untreated, my bi-polar disorder gives me the occasional — albeit skewed — idea of how crippling pessimism can be, and the damage that optimism can cause. These extremes aren’t indicative of much in the real world, but they do give me the impression that optimism is more fun. But my life has proven again and again that the balance between the two is the sweet spot.

Maybe the world would work better if we were all both, but I think that being able to focus on wild ideas – unencumbered by reality and previous failures – is something that can only be achieved by an individual who just isn’t affected by those facts and that data. And being the force that prevents suicidal leaps is better left to those who can own the responsibility. If we all had both personalities, would we cancel ourselves out before we had a chance to evolve ideas?

I’m absolutely not implying that a realistic approach never leads to innovation. I have noticed, however, that major leaps forward in human progress are usually the result of people that could be considered insane. Insanely optimistic about the potential outcome of an experiment, and willing to risk life and limb just to find out.

My point is, optimism is not the shining light of the enlightened human being. I’m tired of reading “inspirational” quotes on Facebook about how optimism is a goal we should all strive toward. Optimism and pessimism are not light and dark sides, they’re complementing halves of the same token. We need each other, you and I.

What We Do

Code School is an online learning destination for existing and aspiring developers that teaches through entertaining content. Each course is built around a creative theme and storyline so that it feels like you’re playing a game, not sitting in a classroom.

We combine gaming mechanics with video instruction and in-browser coding challenges that make learning both educational and memorable. With more than 40 courses covering JavaScript, HTML/CSS, Ruby, Git, and iOS, Code School pairs experienced instructors with meticulously produced, high-quality content inspired by our community and network of members.

More than a million people around the world come to Code School to get started with a new technology and learn by doing.

The Inspiration

Coding skills have never been in higher demand, but traditional computer science courses are often costly, time consuming, and lack the flexibility many people demand. Meanwhile, technology is moving quicker than ever and to stay current, many developers must constantly be learning new skills outside of their day jobs. This has left room for new approaches to code education.

In our opinion, the best way to learn is by doing. Code School opens the door to a new way of learning by combining high-quality video, in-browser coding, and gamification to make learning fun!

I’m buried in development work on a new version of Marked 2 (I’ll post more about the updates soon), the commercial replacement for nvALT (more on that closer to release), and some important side projects, so my posting rate has been a little lower lately. It will ramp back up soon.

I’ve also been writing at MacStories, and posted reviews of Typed for Mac and Dash 3 last week. Keep an eye out there for more news and reviews, including one of the new version of Tembo that came out last week.

And then there are the podcasts. Systematic is going strong and has had some great guests since the last time I mentioned it. Rather than list them all (and some upcoming gems), I’ll refer you to the ESN page. Keep listening! Overtired had a couple of weeks off between WWDC and Christina’s packed schedule of interviewing amazing people, but the latest episode is packed with fun conversations on tech and pop culture, with plenty of movie reviews. It should be out in the next day or two, so keep an eye out!

By the way, I’m planning to start a subscription newsletter soon, and all supporting members will have access. The newsletter will include answers to member questions, bonus “web excursions,” and more, but everything I’ve always posted on this blog will continue to be provided for free.

Feeder is an extremely useful app for building RSS feeds, including podcast enclosures and Sparkle XML feeds for software updates. Version 3 is great, so if you’re in need of a really simple way to create custom feeds, check it out.

This is looking great. My system has diverged enough that I probably won’t be able to implement a lot of it without some re-working, but if you’re looking at Jekyll, be sure to try out Octopress 3 in the exploration process.

No matter what kind of designer you are, you love a good font. Even better is a good free font. So we’ve combed the Web for some of our favorite free fonts, and gathered them here in a single download.

You’ll find a variety of useful typefaces, from highly geometric designs to elegant cursive scripts, from modern minimalism to traditional text faces.

This app takes a while to process a large library, but being able to dump my Spotify playlists into Apple Music is making doing a real comparison much easier. Note that it imports songs from playlists, but doesn’t recreate the actual playlist. GottaBeMobile offers some tips for finishing the job.

If you’ve never explored Bash’s ~/.inputrc file, there’s a lot of customization you can do in there. From setting completion and Readline options to creating custom keybindings, you can greatly improve your command line efficiency with a little tweaking.

This post is about the latter: custom bindings. Much like OS X keybindings, input keybindings can perform any of the Readline functions, or insert your own text. Using control sequences, you can do things like wrap the existing command, insert common snippets, and perform a variety of completion functions.

As an example of text navigation bindings, you’ll commonly see these:

"\e[1;5C": forward-word
"\e[1;5D": backward-word

The first part (before the colon) is the keybinding, the second half is the command. In this case, they’re Readline commands for moving the cursor by word. \e represents the Option key (Alt on a PC), and the escape sequences after them are for the left and right arrow keys. This pair allows you to move the cursor left and right by word boundaries using Option-Left and Option-Right.

To get more interesting, here are a couple examples of modifying the current command using keybindings. You can add these to the ~/.inputrc file, then run bind -f ~/.inputrc to source them immediately. (This file is sourced by Bash on login, so in the future you won’t need to do anything to use them.)

Jump to the target folder of the last command and run ls with Option-x

"\ex": 'cd !$ \015ls\015'

This is great right after you run an extract (tar, unzip, etc.) to a folder or git clone repository destination command. Pressing it right away will change to the folder where you extracted or cloned to and give you a directory listing.

The \015 represents the enter key, but you can also use \C-m for the same result.

Undo a directory change with Option-z

"\ez": 'cd -\015'

This one is simple: when Option-z is pressed, run cd - to return to the previous directory. Again, the \015 presses Enter after inserting the command text so that it runs immediately.

Modify a command in place

Using Readline/Emacs control sequences such as Control-a (beginning of line) and Control-e (end of line), You can move the cursor around as you insert text from a macro.

This one jumps to the beginning, inserts some text, then jumps to the end to insert some more text, then jumps back to the beginning to leave the cursor in a position for editing:

"\e\C-m": '\C-a "$(\C-e)"\C-a'

It assigns Option-Return to wrap the current line as an inline command substitution, and places the cursor back at the beginning. So if the command you type will have output that you want to do something else with, you can hit Option-Return and then type the command that will take the output as the argument. For example, if I’ve typed:

$ find -type f -name "app.js" | head -n 1

it’s going to return the first result as a full path. Maybe I just want to go ahead and print out the contents of that result, so I hit Option-Return and type less, then hit Return. The resulting command is:

$ less "$(find -type f -name "app.js" | head -n 1)"

Automatically submit output

Here’s a variation that uses the !! operator to repeat the last command, then pipes the result to fzf (command line fuzzy finder), returning the result of my selection to whatever command I’ve prefixed.

"\e/": '"$(!!|fzf)"\C-a \C-m\C-m'

To use it, I would type the command I want to run on the resulting selection from the last command’s output, then hit Option-/ (forward slash). So if I’ve run a simple ls *.md command, I can type mmdc, and then hit Option-/, and it will re-run the ls command and pipe the contents of the current directory to the interactive selection tool, and whichever file I hit Enter on will be opened in MultiMarkdown Composer (using the mmdc utility).

The \C-a followed by a space in this macro will jump to the beginning of the line and insert the space, which will prevent the command from being added to shell history (if you have the HISTCONTROL=ignorespace history option enabled).

Because I have the magic-space history expansion enabled (Space: magic-space in .inputrc), the space after the \C-a will also expand the !! to the full command. I follow it with two \C-m (Returns) because of the way this shell expansion is set up in my Terminal, but in some cases a single \C-m (or \015) will do the trick.

These are just some ideas. The Bash bindings in hstr use this trick to replace Control-R history search with an interactive, fuzzy-matched history tool. If there are certain commands you use frequently, you can make just about anything work with this.

Bonus Tip

In Bash, there are some great but lesser-known default bindings. You may know that Option-. will insert the last argument of the previous command (e.g. running ls ~/Desktop and then typing cd and pressing Option-. will turn it into cd ~/Desktop), but did you know you can actually yank the argument at any index from the last command (without using history or ! operators)?

Just press Option-[#], where # is the position of the argument you want, then type Option-. to insert it in the current command.

Thanks to Smile and TextExpander 5 for sponsoring BrettTerpstra.com this week! TextExpander has been a vital part of my workflow on every Mac I’ve ever owned, and version 5 does not disappoint.

TextExpander helps you type faster by allowing you to define abbreviations that expand into text, rich text, or even images when you type them. Version 5 speeds up your typing even more by letting you know when you repeat frequently-typed phrases, and making it easy to add abbreviations for them. TextExpander 5 also reminds you of missed opportunities to use your existing abbreviations while you’re typing.

I’m a fan of Victor Agreda Jr., comedian, thinker, and former editor-in-chief of The Unofficial Apple Weblog. His personality is edgy and raw, and one to which I’ve always been able to relate. This article from his hometown newspaper was a great read. There’s a good Systematic episode with Victor, as well.