I thought it would be fun and convenient to post to Twitter from the command line, so I wrote a little shell script to do just that. You can download it here. Just place it somewhere in your $PATH, set the executable bit, and then you can do this from anywhere:
$ twit
Simple as that. It does have a few features to be aware of:
The script will prompt you for your Twitter username and password, unless you set the
$TWITTER_USERand$TWITTER_PASSenvironment variables (in.bash_profileor wherever)You can optionally select an image to post, in which case it will be uploaded to TwitPic
All the prompts use readline, so you get filename completion, emacs/vi editing mode goodness, and the benefits of whatever you have set in your
.inputrcThe response is in XML format and just dumped to STDOUT unprocessed. No fancy parsing or formatting. After all, XML is human readable, right? Right?
Finally, it requires you have curl installed. But you already use and love curl, don't you?
Interstate, my little iPhone web app for your co-pilot on long road trips, has been updated to run in full-screen mode. The update removes the browser chrome, giving the app the feel of a native application.
If you already have it saved to your home screen, you must remove it then re-add it to see the update.
First, John Gruber released his Title Case Perl script. Then Dan Benjamin issued a challenge to the Ruby community to do likewise, with prolific results. Finally, John asked for JavaScript implementations.
Not wanting to be left out of the fun, and having blatant disregard for my priorities at work, I came up with my own solutions. These are mostly straightforward ports of Gruber’s script — not very original or clever like some others, but they have the desired effect.
My first attempt is written in Python. It can be used as a module or from the command line. For example, to use as part of a larger program, you can import it:
from titlecase import titlecase
print titlecase('"Nothing to Be Afraid of?"')
Or you can read from STDIN:
$ python titlecase.py < examples-edge-cases
The latter example processes all lines in the file examples-edge-cases (taken from here) and prints the results to STDOUT.
Next, I wrote a JavaScript version. Usage is dead simple:
'"Nothing to Be Afraid of?"'.toTitleCase();
I only added the method to the String object’s prototype chain, which makes it not quite a flexible as some other implementations. For example, my method cannot be passed as a callback or mapping function.
One interesting note came about during the discussion of John Resig’s script: IE’s String.prototype.split method is broken. I got around that by building the tokenizer using regexp.exec instead. That’s the great thing about public discussions on these topics: I always come away from it learning a thing or two!
(BTW: check out this implementation by David Grouch. Short, sweet, very “JavaScript-esque”. And it handles more edge cases than any other implementation I’ve seen yet!)
My wife and I play a silly little game to pass the time on long road trips. It consists of taking note of license plates from as many states (and Canadian provinces) as possible while on the road.
Typically, we just scribble them down on a piece of paper and count them up at the end of a trip. But as we all know, if something is worth doing, it is worth overdoing, so I went ahead and made an iPhone “web app” (if one can even call it that) to manage the process.
I call it Interstate. It is about as simple as an iPhone app can be, providing an alphabetical checklist and running tally. Here is a screen shot:

Check it out using your iPhone (or Safari 3.x) at http://interstate.stringify.com/.
How to start off a client relationship on the wrong foot, in four easy steps:
- Tell the client they can call you at a specific time
- Leave your phone out of earshot at said time
- ???
- Unprofit!