it all flows together

scott barber blog

Archive for the ‘ruby’ Category

Rails flash loop

Friday
Apr 20,2007

Thanks Railscasts!

<% flash.each do |key, msg| %>
<%= content_tag :div, msg, :id => “flash_#{key}” %>
<% end %>

Pimp my VOIP

Thursday
Mar 8,2007

One of *the* coolest things in the ever colliding worlds of Asterisk and Ruby: Adhearsion

Capistrano Love

Tuesday
Feb 27,2007

Did you know that you can deploy your rails app with just the deploy.rb file?

Download your deploy.rb file and hit it:

[sbarber@awhpbl01 onlinerss]$ ls
deploy.rb
[sbarber@awhpbl01 onlinerss]$ RAILS_ENV=qa cap -f ./deploy.rb deploy
  * executing task deploy
  * executing task update

Yeah - cap rocks.

Tuesday
Jan 23,2007

I just ran across an alternative to Pound / Pen for Mongrel balancing…
PLB.

Mtn West Ruby Conf

Tuesday
Jan 23,2007

Just registered for the Mountain West Ruby Conference to be held back in SLC, UT in March. See you there.

Thursday
Jan 11,2007

Apple iPhone: Will it run Ruby? Leopard will have it

Once again I’ve falled in love my MythTV. I’ve been running it for about 5 months solid now. no reboots, or big issues to deal with. A few recent tweaks: Added my ROM collection over a remote share for MythGame. New favorite mythtv theme: blootube. I transcode any new recordings to XviD (with commercial skip) and then move them to my NAS video share for future viewing.

Recent change of heart: Fav Desktop OS -> OSX. Still really love Ubuntu for servers, etc.

This time of year I love living in Arizona. Did you get snow recently? Gee… that’s too bad. I think we’re looking at 68 today. LOL!

Street Cred

Friday
Nov 17,2006

Working on some street cred in the community. See me at: Working With Rails: People

It’s like MySpace for Rails folks :)

Hey - I almost presented during the lighting talks in RubyConf.

Monday
Oct 30,2006

During RubyConf I had a chance to sit next to John Long of RadintCMS fame. He’s a cool guy and Radiant is awesome for simple websites. I’m using Radiant for a few of my customers simple websites.

Not to be outdone in the coding arena, here are my important contributions to RadiantCMS. I call this collection of code “Inappropriate Text Filters.”

Markdown? Textile? You got nothing on me:

Filter #1: piglatin_filter.rb
class PigLatinFilter < TextFilter::Base
register 'PigLatin'
def filter(text)
text.split.collect{|word| pig(word)}.join(" ")
end
def pig(word)
leadingCap = word =~ /^A-Z/
word.downcase!
res = case word
when /^aeiouy/
word+"way"
when /^([^aeiouy]+)(.*)/
$2+$1+"ay"
else
word
end
leadingCap ? res.capitalize : res
end
end

Filter #2: crypt_filter.rb
class CryptoFilter < TextFilter::Base
register 'Crypto'
def filter(text)
text.crypt("da_salt_")
end
end

Filter #3: reverse_filter.rb
class ReverseFilter < TextFilter::Base
register 'Reverse'
def filter(text)
text.split.collect{|word| word.reverse!}.join(" ")
end
end

Fixed Hpricot tag!

Friday
Oct 20,2006

Yay! I _why fixed the ticket I opened with Hpricot:

#14 (Tag parsing funky-ness, or how I learned to stop worrying and love the malformed tag) on Hpricot

Off To RubyConf

Thursday
Oct 19,2006

The plane leaves for Denver bright and early at 6:04. See you there!

Meta


Blogroll


Twitter


My del.icio.us


RSS My last.fm