Nov 17
2009
I do a lot in Terminal. Sometimes, it’s easier. Sometimes it’s faster. Sometimes I’d just rather type it out. Whatever the reason, I’ve never been able to stand looking at a boring shell prompt. Bash is my primary shell, mostly because I’ve never taken the time to learn much else. I’ll get there someday. For now, here’s my current Bash shell prompt…
I’m using the PROMPT_COMMAND variable to run a few quick functions to generate the prompt. It doesn’t do anything processor-intensive, so I haven’t seen any lag caused by this one (unlike some of my previous experiments). PROMPT_COMMAND is set to call a function called, appropriately, prompt_command(). This, in turn, calls a few external functions defined in my .bash_profile. To use it, just stick all of the code below into your .bash_profile, and modify it as you see fit. Be sure to replace any definitions of PROMPT_COMMAND or PS1.
Continue reading “My new favorite Bash prompt…”
Nov 14
2009
This is a function from my OS X .bash_profile. ‘fk’ is short for Find and Kill, and it lets you do a quick search of your running processes for a case-insensitive partial match of the first parameter passed to it. It’s useful for quickly finding a process without worrying about its capitalization or full spelling, and without having to sift through (or manually grep) a long ps ax list.
Continue reading “fk: a useful bash function…”
Nov 12
2009
This is a quick and dirty Snow Leopard Service that scrapes Songza.fm to find a song related to your selected text in most applications. It replaces the selected text with an is.gd shortened link and the name of the first song it found (just to be sure you’re on the same page… literally). The code is also available as a TextMate command for those interested. Update: TextMate command with link selection popup.
The service (and TextMate command) require the Hpricot gem for ruby. In most cases, this should be installable from the command line with sudo gem install hpricot. If you see errors, you may need to update some Ruby components. Once that’s set, just install the workflow in ~/Library/Services and it should immediately start showing up in your services menu. Add a shortcut for it in Preferences -> Keyboard -> Shortcuts -> Services. Next time you’re tweeting or writing an email about a song, why not send a Songza link to back up your point?
Continue reading “Songza Lucky Link Service…”
Nov 12
2009
Test post from my iPhone. I figure if this is slick enough, I might blog more… Guess we’ll find out.
Nov 03
2009
It may take me a while to convert my setup back to the old days of TextMate blogging. I’ve primarily been blogging for TUAW, which uses a blogging system with very poor XMLRPC support. The end result of this, for me, was the development of an elaborate TextMate bundle which emulated the ease-of-use that TextMate provides to bloggers on Wordpress (and other platforms). I have, I guess, forgotten how to do this. So this post is going to begin as a test, to be continued with some ideas, some tools, and some discoveries I’ve made in my time away from the glory of TextMate blogging.
This paragraph is just to see if I can get an XMLRPC image upload to float left without additional Markdown code.
Nov 03
2009
Clippable to Evernote will allow you to trigger the Clippable bookmarklet in Safari and copy the result directly to your “Unfiled” notebook in Evernote. This service is Snow Leopard-only. If you need it modified for Leopard and aren’t sure how, let me know. If there’s some interest, I’ll just work one up and post it.
To install in Snow Leopard, just unzip (double-click the zip file) the file and move the resulting .workflow file to [your home directory]/Library/Services. It should now appear in your Safari->Services menu, in Safari only. To add a keyboard shortcut to the Service, go to the Keyboard pane in System Preferences, choose the Keyboard Shortcuts tab, select Services on the left and find the Clippable… service on the right. Double click on the right side of the listing to enter a hotkey. I currently have mine bound to control-command-E, which works well for me in Safari.
Download here.
Nov 03
2009
11.03.09 Renaming Readable2 to Clippable, I think. At least that’s what it’s going to be on the code page, for now.
The Clippable bookmarklet can be found here.
The original Readability bookmarklet by Arc90 is here.
Posted in Code | Comments Off