Home Link

Hello, my name is Brett Terpstra, and it’s nice to meet you. Elegant solutions to complex problems. Curious?

Archive for November, 2009

  • Jan
  • Feb
  • Mar
  • Apr
  • May
  • Jun
  • Jul
  • Aug
  • Sep
  • Oct
  • Nov
  • Dec

Nov 17
2009

I do a lot in Ter­mi­nal. Some­times, it’s eas­ier. Some­times it’s faster. Some­times I’d just rather type it out. What­ever the rea­son, I’ve never been able to stand look­ing at a bor­ing shell prompt. Bash is my pri­mary shell, mostly because I’ve never taken the time to learn much else. I’ll get there some­day. For now, here’s my cur­rent Bash shell prompt…

I’m using the PROMPT_COMMAND vari­able to run a few quick func­tions to gen­er­ate the prompt. It doesn’t do any­thing processor-intensive, so I haven’t seen any lag caused by this one (unlike some of my pre­vi­ous exper­i­ments). PROMPT_COMMAND is set to call a func­tion called, appro­pri­ately, prompt_command(). This, in turn, calls a few exter­nal func­tions defined in my .bash_profile. To use it, just stick all of the code below into your .bash_profile, and mod­ify it as you see fit. Be sure to replace any def­i­n­i­tions of PROMPT_COMMAND or PS1.

Con­tinue read­ing “My new favorite Bash prompt…”

Nov 14
2009

This is a func­tion from my OS X .bash_profile. ‘fk’ is short for Find and Kill, and it lets you do a quick search of your run­ning processes for a case-insensitive par­tial match of the first para­me­ter passed to it. It’s use­ful for quickly find­ing a process with­out wor­ry­ing about its cap­i­tal­iza­tion or full spelling, and with­out hav­ing to sift through (or man­u­ally grep) a long ps ax list.

Con­tinue read­ing “fk: a use­ful bash function…”

Nov 12
2009

This is a quick and dirty Snow Leop­ard Ser­vice that scrapes Songza.fm to find a song related to your selected text in most appli­ca­tions. It replaces the selected text with an is.gd short­ened link and the name of the first song it found (just to be sure you’re on the same page… lit­er­ally). The code is also avail­able as a Text­Mate com­mand for those inter­ested. Update: Text­Mate com­mand with link selec­tion popup.

The ser­vice (and Text­Mate com­mand) require the Hpri­cot gem for ruby. In most cases, this should be instal­lable from the com­mand line with sudo gem install hpricot. If you see errors, you may need to update some Ruby com­po­nents. Once that’s set, just install the work­flow in ~/Library/Services and it should imme­di­ately start show­ing up in your ser­vices menu. Add a short­cut for it in Pref­er­ences -> Key­board -> Short­cuts -> Ser­vices. Next time you’re tweet­ing or writ­ing an email about a song, why not send a Songza link to back up your point?

Con­tinue read­ing “Songza Lucky Link Service…”

Nov 12
2009

Test post from my iPhone. I fig­ure if this is slick enough, I might blog more… Guess we’ll find out.

Nov 03
2009

It may take me a while to con­vert my setup back to the old days of Text­Mate blog­ging. I’ve pri­mar­ily been blog­ging for TUAW, which uses a blog­ging sys­tem with very poor XMLRPC sup­port. The end result of this, for me, was the devel­op­ment of an elab­o­rate Text­Mate bun­dle which emu­lated the ease-of-use that Text­Mate pro­vides to blog­gers on Word­press (and other plat­forms). I have, I guess, for­got­ten how to do this. So this post is going to begin as a test, to be con­tin­ued with some ideas, some tools, and some dis­cov­er­ies I’ve made in my time away from the glory of Text­Mate blogging.

This para­graph is just to see if I can get an XMLRPC image upload to float left with­out addi­tional Mark­down code.

Nov 03
2009

Clip­pable to Ever­note will allow you to trig­ger the Clip­pable book­marklet in Safari and copy the result directly to your “Unfiled” note­book in Ever­note. This ser­vice is Snow Leopard-only. If you need it mod­i­fied for Leop­ard and aren’t sure how, let me know. If there’s some inter­est, I’ll just work one up and post it.

To install in Snow Leop­ard, just unzip (double-click the zip file) the file and move the result­ing .work­flow file to [your home directory]/Library/Services. It should now appear in your Safari->Services menu, in Safari only. To add a key­board short­cut to the Ser­vice, go to the Key­board pane in Sys­tem Pref­er­ences, choose the Key­board Short­cuts tab, select Ser­vices on the left and find the Clip­pable… ser­vice on the right. Dou­ble click on the right side of the list­ing to enter a hotkey. I cur­rently have mine bound to control-command-E, which works well for me in Safari.

Down­load here.

Nov 03
2009

11.03.09 Renam­ing Readable2 to Clip­pable, I think. At least that’s what it’s going to be on the code page, for now.

The Clip­pable book­marklet can be found here.

The orig­i­nal Read­abil­ity book­marklet by Arc90 is here.

Entries (RSS) and Comments (RSS).

Switch to Mobile version