Welcome to the lab.

In defense of pessimism

[Tweet : ADN : nvALT]

Pardon me while I wax philosophical for a moment.

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.

Web Excursions for July 20, 2015

[Tweet : ADN : nvALT]

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.

Without further ado, the web excursions:

Feeder 3.0 Now Available
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.
Balloon
Balloon is a drop box for your Dropbox. Share your Balloon to receive files straight to your Dropbox. There’s no signup for senders, just share a link.
Palette Gear: Hands-on Control of your Favourite Software
Snap-together sliders, dials and buttons for intuitive, precise and custom control of your software. These look like a blast.
Get The New BitTorrent Sync API
I hope to see more apps start integrating Bittorrent Sync. The first major integration is OneHub.
Octopress 3.0 is coming
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.

Web Excursions for July 13, 2015

[Tweet : ADN : nvALT]

Ghostnote
This is a pretty amazing idea. Contextual notes for any file, folder, or website. Every time you open it, it shows the notes for the current context.
Cheaters LaunchBar Action
A LaunchBar action for Cheaters.
Getting my Daily To Do List Out of OmniFocus
Jason Verly created a nifty way to get things done using OmniFocus, a bit of scripting, and Marked 2.
HOKO - Mobile deep linking simplified
A handy framework for easily implementing deep links in iOS 9 and Android apps, including metrics.
STAMP - import Spotify playlist to Apple Music easily
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.

Shell Tricks: .inputrc binding fun

[Tweet : ADN : nvALT]

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.

The Bash reference at Gnu.org offers a complete listing of escape sequences and Readline functions.

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.

Web Excursions for July 06, 2015

[Tweet : ADN : nvALT]

Safari is(‘nt?) the new IE
A post from Nolan Lawson titled Safari is the new IE set off a discussion of Safari’s development, broaching a concern I’ve had for a while now.
Jason Snell offers a measured response in Web developers are grumpy about Safari
Rene Ritchie offers a rebuttal in Safari isn’t the new IE: it’s the user-centric web
Nolan follows up with Safari is the new IE 2: Revenge of the Linkbait
iPhone, iPad, Mac Buyer’s Guide: Know When to Buy
MacRumors offers a very handy guide showing average product cycles and time since last release, aiding buyers in deciding the timing of a purchase of a given line of Apple products.
What’s Victor Agreda Jr. Going to Do Next?
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.
Zuli Smartplug Presence Pack
I haven’t had a chance to try these out yet (they start shipping in 6-8 weeks), but it might be a leap forward in my decade-long quest for accurate proximity detection for home automation.
TinyWord
This looks like a good Word/Pages alternative for people who want true rich text editing. Inexpensive at $1.99.

CodeReminder: don’t forget to play

[Tweet : ADN : nvALT]

I put together a little utility this morning to help me remember what GitHub repositories I’ve grabbed with the intention of playing with later. I often clone or fork a repo and plan to explore it over a weekend, but then quickly forget about it if I don’t add a reminder.

CodeRemind works with Reminders.app and/or OmniFocus. When you run it with no arguments, it will add a Reminders.app task to a “Code Reminders” list, using the base name of the current folder as the title, with the full file path as a note. You can use -r (reminder) and/or -t (OmniFocus task), add an additional note (-n NOTE), and optionally provide a custom path to override the use of $PWD. The default type and the name of the list/project can be configured in the script. Configuration and usage details are available on the project page.

I could come up with a Pinboard system to deal with this, but making it work the way I want would require deleting bookmarks, removing a “playwith” tag, or adding a “playedwith” tag to simulate a checklist, and that’s extra work with potential messiness. I could also use a TaskPaper list, but my current system uses TaskPaper documents per-project, and overarching tasks are added to OmniFocus (or doing if I’m actively pursuing them). This system just provides tidy checklists for things I might get around to but which have no real urgency. It’s just a temporary bookmarking system.

See the CodeReminder project page for source code and documentation.