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.
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 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.
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:
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.
\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).
\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
\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.
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
Just press Option-[#], where # is the position of the argument you want, then type Option-. to insert it in the current command.