hoodwink.d enhanced
RSS
2.0
XHTML
1.0

RedHanded

Monday

2005.01.31

Dynamic VHosts One-liner for Rails #

by why in bits

So, how do Tada and Basecamp do dynamic virtual hosts to give each user their own subdomain? Drop this in ApplicationController:

 before_filter { |c| c.account =
   Account.find_by_subdomain(c.request.subdomains.first) }

Bravo. Requires a ServerName *.tadalist.com in the Apache VHost configuration and an accounts table with a subdomain field. (seen among #rubyonrails quotes.)

Update: If you’re struggling to get this to work, mpet45 has more. Configuring DNS and all that.

If You Buy One Crossstitch This Year #

by why in cult

After coding with Ruby, I am putty in the palm of my sturdy, red easychair.

Twelve dollar kit from The Red Hat Society. An unbelievable array of unintentional pun crossover for fans of ruby-1.8.2-28.i386.rpm who frost their hair.

Naturally, the kit’s default slogan—“Ruby Relaxes”—could be replaced. Try “Ruby Cracks My Back” or “After an Evening of REXML, I Am Putty in the Palm of My Sturdy, Red Easychair.” Also see: I Shall Wear Purple and Red.

Uh, Most of You Have Been Blogging Involuntarily and Plagiarizing Jeremy Zawodny Involuntarily #

by why in cult

If you have been participating in the Rails mailing list, then you’re helping to author this blog. And if you’re on Ruby-Talk, then you’re posting here. And, Ruby-Core is this blog.

This is excellent! If you can’t keep up with all the Ruby-Talk messages, scale back to the RSS feeds of the above instead. Its threading isn’t perfect, but it tries to pin a country flag on the authors, which is especially pertinent to our divergent peoples.

Update: Okay, a directory of all Ruby newsgroups covered. Also, working on a RedHanded stylesheet.

Writing C -- in Ruby! #

by why in cult

Ryan Davis says ruby2c is mere hours away. His goal has been to translate the entire Ruby stdlib. Which is happening.