I’m a freelancer. I’ve worked in interactive media/web design, print design, programming, advertising and marketing. Like any good designer/programmer, I solve problems. I’m especially good at finding the right tool for the job, even if that means making my own. My websites and my apps are designed and developed with the goal of being future-proof, maintainable and easily built-upon.
I write about tech, and you can often find me blogging over at TUAW. Besides being a Mac nerd, I’m a gadget nerd, a music nerd and I have a strange obsession with finding the perfect computer keyboard.
I’m available for jobs large and small, and you can contact me by clicking here. I’m usually able to travel as necessary.
Read on »
From the Blog
Mar 08
2010
I posted a way to save your Safari tabs to Evernote, which I’ve found is generally a great way to save bookmarks. It syncs automatically to your other computers and your iPhone, and it’s fast and easy. If you really want to highlight a few tabs to make sure you get back to them, you might consider this script, though. Once you’ve saved your entire Safari browsing session for later, close everything except for those special urls, run the code below as a script, and your open tabs will be saved as entries in your InstaPaper account.
There are two “property” lines at the top of the script; edit them to set your Instapaper username and password (if you have one, otherwise, set it to ""). The next section handles everything, iterating through each tab, grabbing its title and url and building a shell command to do a simple curl call to the InstaPaper API.
After that, the rest of the script is a routine for url encoding that I nicked here. It’s called when setting both the _title and _url variables to make the curl call from the shell work. I haven’t tested this extensively yet, but it’s worked for everything I’ve tried. A title with odd characters in it could potentially cause problems. You can always add a shell-escaping routine…
property _user : "yourusername"
property _pass : "yourpassword"
tell application "Safari"
repeat with _tab in tabs of front window
set _title to my urlencode(name of _tab)
set _url to my urlencode(URL of _tab)
set _script to (¬
"curl 'https://www.instapaper.com/api/add?username="¬
& _user & "&password=" & _pass & "&url=" & _url & "&title=" & _title & "'")
set output to do shell script _script
end repeat
end tell
on urlencode(theText)
set theTextEnc to ""
repeat with eachChar in characters of theText
set useChar to eachChar
set eachCharNum to ASCII number of eachChar
if eachCharNum = 32 then
set useChar to "+"
else if (eachCharNum ≠ 42) and (eachCharNum ≠ 95) and¬
(eachCharNum < 45 or eachCharNum > 46) and (eachCharNum < 48 or eachCharNum > 57)¬
and (eachCharNum < 65 or eachCharNum > 90) and (eachCharNum < 97 or eachCharNum > 122) then
set firstDig to round (eachCharNum / 16) rounding down
set secondDig to eachCharNum mod 16
if firstDig > 9 then
set aNum to firstDig + 55
set firstDig to ASCII character aNum
end if
if secondDig > 9 then
set aNum to secondDig + 55
set secondDig to ASCII character aNum
end if
set numHex to ("%" & (firstDig as string) & (secondDig as string)) as string
set useChar to numHex
end if
set theTextEnc to theTextEnc & useChar as string
end repeat
return theTextEnc
end urlencode
Open this script in your Script Editor.
Mar 06
2010
Another post, quickly and with less explanation…
The fact that Evernote processes HTML so much better than it does plain or rich text got me thinking and tinkering. I use Markdown (actually, MultiMarkdown) constantly, and it does a great job of turning plain text into valid markup. With (Multi)Markdown, even plain text becomes HTML that–when imported into Evernote–retains most of its formatting. To answer your question, no, I’m not obsessed with Evernote, I’m obsessed with problems I think I could solve. It’s unhealthy.
Please note, this requires that you have Fletcher Penney’s MultiMarkdown installed in ~/Library/Application Support/MultiMarkdown, and that the Perl files (MultiMarkdown.pl and SmartyPants.pl) are located in a ‘bin’ subdirectory (which is the default install). If you don’t have MultiMarkdown, you should get it anyway (all the cool kids have it), so head over to the download page and grab a copy. Now, on with the show.
I set this up originally as a TextMate command, intending just to be able to clip code snippets and free-form text to Evernote without thinking too much about it. That worked well, so I modified it to work as a System Service. Specifically, a Snow Leopard service, but I’m providing the Ruby script here and it can be modified for any Mac setup you want.
While it will work just fine on plain text with no markup, it does have a couple of “special” features. If you start a line with a # and a space (e.g.: # This is my header), which is a Markdown convention for a first-level heading, it will use that as the title for the note and strip it out of the text in processing. It only uses the first one it finds, but it will strip out any first-level headers in the selection. I’ll probably modify that later, or just have it leave them in. Also, a line that begins with “tags:” followed by a space and a comma-separated list of words will be split up and used to tag the new note. This is also stripped before processing. It handles spaces in multi-word tags, and odd marks at the beginning or end of a tag, but only one punctuation character, and only at the beginning or end of a tag. The code follows…
Continue reading “A better System Service for Evernote clipping — with MultiMarkdown…”
Mar 06
2010
Just a quick change to my post on the bash function fk that I’ve been using. A small modification has greatly improved its usability: make the cancel option always be first in the menu. Just move “Cancel” before the $(fp $1) bit. It’s a little odd that I didn’t do that to begin with…
fp () { #find and list processes matching a case-insensitive partial-match string
ps Ao pid,comm|awk '{match($0,/[^\/]+$/); print substr($0,RSTART,RLENGTH)": "$1}'|grep -i $1|grep -v grep
}
fk () {
IFS=$'\n'
PS3='Kill which process? (1 to cancel): '
select OPT in "Cancel" $(fp $1); do
if [ $OPT != "Cancel" ]; then
kill $(echo $OPT|awk '{print $NF}')
fi
break
done
unset IFS
}
Mar 06
2010
I primarily use Safari for web browsing, mostly because it’s smoother and faster than Firefox, and the Web Inspector is just as useful as Firebug. As time passes, I end up with a lot of web pages open, and I like to clear out my browser tabs on a regular basis. Safari doesn’t really have a long-term session-saving option, so I save lists of open tabs…
Read…
Feb 26
2010
I’ve pushed out an update to Clippable, for better or worse. In addition to the previously added line number removal for code blocks, it removes spans used in TextMate formatted code and adds some keyboard shortcuts:
Left arrow: switch to light on dark Right arrow: switch to black on white Delete key: return to normal formatting Escape key: return to original page
These features are added without modifying…
Read…
Jan 29
2010
I apologize for the recent downtime, which also affected the Clippable bookmarklet’s ability to work. Dreamhost has been pretty awful with downtime lately, and my attempt to switch to a different physical server resulted in a horrible mess for myself and several clients. I have to say that Dreamhost support was extremely helpful in repairing the situation… their support is the main reason…
Read…
Jan 29
2010
I’m sitting at the airport in Minneapolis, waiting for a flight to Atlanta. I’m headed for Big Nerd Ranch for a week-long crash course in iPhone programming. I’ve done a little, but I think it will be a great way to start from the basics and fill in all of the holes in my knowledge. The thing is, I’m a little torn about the circumstances; Big…
Read…
Dec 31
2009
Download the Evaluate Expression Snow Leopard service: EvaluateExpressionService.zip
This is a stripped down version of a command I have in the TextMate bundle we use at TUAW. It allows you to select any basic numeric equation and evaluate it, replacing the selected text with the results. It will ignore your text if it contains anything but numbers and basic mathematical symbols. Sure, there are…
Read…
Dec 31
2009
I made a couple of minor changes to the Clippable bookmarklet, mostly in the way it handles SyntaxHighlighter code blocks. The SyntaxHighlighter plugin is used (too) often to format and color code source snippets in websites. The result when clipping a page is that the code you get still has line numbers, but no option to view the raw source without going…
Read…
Dec 12
2009
Erica Sadun recently released her latest app, Draw (iTunes link), into the wilds of the App Store. I take a special interest in this release because I designed the interface for it from the ground up. Erica, of course, made all of the magic happen; she’d take my phởtoshop sketches and send them back as amazing working interfaces. In the end, it was…
Read…
Dec 12
2009
Well, I’ve been out of touch with a lot of people for the last four days, and I thought I’d save some time and provide a place I could link everyone to for a quick explanation. On Tuesday evening, in the middle of what the weather service is calling our “worst storm in 20 years,” I started having stomach cramps. I won’t go into detail about what followed,…
Read…
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…
Read…