Category: Programming

How to Automatically Link URLs in Rails

Let’s say you have a Rails app and you’d like any URLs in any plain text string to be automatically hyperlinked. Well, then you’ll need this: .gsub(/((http|https)://[a-z0-9]+([-.]{1}[a-z0-9]+)*.[a-z]{2,5}(([0-9]{1,5})?/.*)?)/, ‘<a href=’1′>1</a>’) For example: I blog at http://garrickvanburen.com Through: “I blog at http://garrickvanburen.com”.description.gsub(/((http|https)://[a-z0-9]+([-.]{1}[a-z0-9]+)*.[a-z]{2,5}(([0-9]{1,5})?/.*)?)/, ‘<a href=’1′>1</a>’) Results in: I blog at http://garrickvanburen.com

SSHKeychain.socket Error on Rake Remote:Setup

Still working through deploying a Rails app (if you’ve been following along, I got Subversion plugged in yesterday). Today was setting up the deployment by running: rake remote:setup The process kept erroring out saying: No File or Directory – /tmp/501/SSHKeychain.socket Turns out I had a bunch of cruft in ~/.MacOSX/properties.plist. After cutting out the offending […]

How To Set Up Subversion, svnX, for TextDrive on OS X

I’m walking through the latest beta version of Agile Web Development with Rails 2nd Edition, specifically the new bits on deploying Rails apps. Capistrano – the preferred and recommended deployment utility. Thing is – Capistrano hinges on Subversion. Not something covered in AWDwR or appropriate to be covered. There’s plenty of other books on the […]

Introducing the HijackingWP Script

One of my biggest problems with podcasting is the production process. Even without editing the audio, the process is far too manual to repeat without inherent discouragement (65 podcasts in year 1 and 20 in year 2 should speak to that). In an effort to publish more and make podcasting as effortless as writing this […]

Using Names in Rails Routes Instead of IDs

I spent tonight cranking through some Ruby on Rails has_many :through association oddities and after pounding my head against the keyboard, I decided to shift gears and figure out Ruby On Rails Routes. By default, the Rails expects ID to be passed in URL strings. But that’s really lame, and passing words is much cooler […]

Anyone Know How to Read the Treo PhoneCallDB.pdb?

Before I got the Treo, I had a SonyEricsson that worked real nicely with BluePhoneElite and my PowerBook. Sure, Caller ID and answering the phone from the laptop was nice, but what I really miss is the integration w/ iCal. Since the Treo keeps a record of the phone calls and their duration and backs […]

Locally Running Multiple Rails Apps on OS X

There’s a couple of place describing how to support multiple Rails apps locally. They were either unavailable or way more complicated than I’d like (the HowtoDeployMoreThanOneRailsAppOnOneMachine at the RubyonRails wiki was both). Here’s how I was able to get multiple Rails apps running under Apache on OS X 10.4 Tiger. Created 2 Rails apps; AppOne […]

What’s Your Favorite Open Source Project?

Hello gentle reader, I’m looking for your favorite open source projects; applications, websites, services. If the code is available for free and you’re a big fan, throw them in the comments. I’ll start: WordPress – weblog engine and content management system Ruby on Rails – web application framework CocoaMySQL – OS X desktop MySQL database […]

Setting up a Web Development Environment in Tiger

This message means the upgrade is complete. Last week I started the upgrade Mac OS X 10.4 “Tiger” around the house. To my pleasant surprise, it went extremely smoothly. The most tedious and frustrating part was waiting for my newly enclosed external hard drive to copy tens of gigs of files back and forth for […]