RV2 Camping on Gentoo
Evan Weaver wrote a SysV init.d setup for daemonizing Camping apps on a *Nix system and documents it in rv, a tool for luxurious camping
I used that blog entry as a reference to build one called RV2 that is a little bit more Gentoo specific. Here are my scripts and directory layout
small urls with Camping
I am happy to announce yet another very small URL generator called
hurl it => http://hurl.it/
In fact its first entry is this very blog post.
There are obvious predecessors and the recent (and very cool) Rails based urlTea which itself I think is inspired by rubyurl
But hurl it is not those things, hurl it is a Camping application. Camping is a Microframework written by why the lucky stiff, a MVC based framework that is a total size of 4K and written in Ruby. Camping applications are small, light weight, and are intended to do one thing really well. hurl it does one thing very well – RESTfully create and serve very small URLs.
hurl it has these attributes
- is a Camping application
- RESTful (index, show, and create verbs) and responds to application/xml
- tunes its use of ActiveRecord for use with the performanced minded MyISAM engine
- developed with Agile practices including full unit and functional tests using Mosquito
- is open source under the MIT License
- has a neat-o base 62 number algorithm using the alphabet of 0-9,A-Z,a-z that would be good to know on an interview
hurl it is meant to be the honey layer in your peanut butter sandwich on wheat bread. hurl it is not the sandwich nor tries to be anything more than really super awesome at representing long URLs as really short URLs.
Things I’ve found helpful during hurl it development
- Evan Weaver Camping Master
- top-secret tuned mysql configurations for rails (EV)
- rv-a-tool-for-luxurious-camping a SysV init.d reference implementation for daemonizing Camping apps (EV)
- Camping, a Microframework (by _why)
- Mosquito Camping test framework (by TF GG)
I wrote a SysV init.d setup for Gentoo based on Evan’s work call RV2
Source
Agile Skateboarding
Update 09/2010: This is one of my favorite Rails and MVC pattern books, please consider purchasing your own copy: Agile Web Development with Rails, Third Edition
I've been helping out a little on Eachday.com and when I was debugging with some real pictures I placed in my account I noticed the agile resemblance. Eachday is an awesome social media site like Flickr but you collect, sort, and display your media along your real life time line. They are using MMS2R technology as well by the way. Maybe I can be on the next cover of Agile Web Development with Rails
Sasquatch, Inc.
I’m now a company!!!
Yet another programmer becomes a consultant.
Linux, Ruby, and a little Java to make some latte money.
handling a rcov non-dependency in your gem on firebrigade
MMS2R was not showing any tests in its firebridge entry because I had a non-dependency for a rcov task that I had included in the MMS2R gem’s Rakefile
This is what Eric says on firebrigade:
This is how to rescue the LoadError exception around the require statement for rcov in the Rakefile :
begin
require 'rcov/rcovtask'
rescue LoadError
end
and this is how I rescue the NameError exception in the rcov task:
begin
Rcov::RcovTask.new do |t|
t.test_files = FileList['test/test*.rb']
t.verbose = true
t.rcov_opts << "--exclude rcov.rb,hpricot.rb,hpricot/.*\.rb"
end
rescue NameError
end
update
07/04/2007
Actually MMS2R is not being tested on the firebrigade currently. The problem stems from a bug in Gems 0.9.4 where MMS2R being dependent on Hpricot and Tinderbox getting a Gem::RemoteInstallationCancelled exception (line 106 of lib/tinderbox/gem_runner.rb) that Eric transforms into a Tinderbox::ManualInstallError
/usr/local/lib/ruby/gems/1.8/gems/tinderbox-1.0.0/lib/tinderbox/gem_runner.rb:108:in `install’: Installation of mms2r-1.1.2 requires manual intervention (Tinderbox::ManualInstallError)
from /usr/local/lib/ruby/gems/1.8/gems/tinderbox-1.0.0/lib/tinderbox/gem_runner.rb:265:in `run’
from /usr/local/lib/ruby/gems/1.8/gems/tinderbox-1.0.0/bin/tinderbox_gem_build:9
from /usr/local/bin/tinderbox_gem_build:16:in `load’
from /usr/local/bin/tinderbox_gem_build:16
Eric says its an known bug in Gems 0.9.4 and should bug them about it!
update
08/01/2007
Eric says that “automatic platform selection to RubyGems” will be fixed on his vacation
Posted in Gems, MMS2R, Ruby, Seattle.rb |
mms2r version 1.1.0 has been released!
mms2r version 1.1.0 has been released!
- http://mms2r.rubyforge.org/
- DESCRIPTION:
MMS2R is a library that decodes the parts of an MMS message to disk while
stripping out advertising injected by the cellphone carriers. MMS messages are
multipart email and the carriers often inject branding into these messages. Use
MMS2R if you want to get at the real user generated content from a MMS without
having to deal with the cruft from the carriers.
If MMS2R is not aware of a particular carrier no extra processing is done
to the MMS other than decoding and consolidating its media.
Contact the author to add additional carriers to be processed by the
library. Suggestions and patches appreciated and welcomed!
Corpus of carriers currently processed by MMS2R:
- AT&T/Cingular => mmode.com
- Cingular => mms.mycingular.com
- Cingular => cingularme.com
- Dobson/Cellular One => mms.dobson.net
- Nextel => messaging.nextel.com
- Sprint => pm.sprint.com
- Sprint => messaging.sprintpcs.com
- T-Mobile => tmomail.net
- Verizon => vzwpix.com
- Verizon => vtext.com
Changes:
- 1.1.0 / 2007-06-08 (Toki Wartooth)
- get_body to return body text (Luke Francl)
- get_subject returns "" for default subjects now
- default subjects listed in yaml by carrier in conf directory
- added granularity to Cingular, Sprint, and Verizon carrier services (Will Jessup)
- refactored Sprint instance to process all media (Will Jessup + Mike)
- optimized text transformations (Will Jessup)
- properly handle ISO-8859-1 and UTF-8 text (Will Jessup)
- autotest powers activate! (ZenTest autotest discovery enabled)
- configuration file ignores, transforms, and subjects all store Regexp’s
- Put vendor Text::Format & TMail::Mail as an external subversion dependency
to the 1.2 stable branch of Rails ActionMailer - added get_number method to return the phone number associated with this MMS
- get_media and get_text attachment_fu helper return the largest piece of media
of that type if the more than one exits in the media (Luke Francl) - added block support to process() method (Shane Vitarana)
- http://mms2r.rubyforge.org/
FizzBuzz Pro, Hire Me
I wrote this code in about one minute in response to Ruby QUIZ #126 :
(1..100).each do |i|
case
when i % 3 == 0 && i % 5 == 0
p "FizzBuzz #{i}"
when i % 3 == 0
p "Fizz #{i}"
when i % 5 == 0
p "Buzz #{i}"
else
p i
end
end
When I wrote it I couldn’t remember if the dot dot .. operator on a range was inclusive or exclusive, fortunately I guessed right.
So you can hire me
The quiz was inspired by this blog post
Why Can’t Programmers.. Program?
My experience has been if you can write white board code fairly well during an interview then you can code fairly well too.
Update
Morton Goldberg wrote many versions but this one with the value to puts chained together with the ternary operator (I think) is The Hot
# ... or even with the ternary operator.
(1..100).each do |n|
puts(
n % 15 == 0 ? 'FizzBuzz' :
n % 5 == 0 ? 'Buzz' :
n % 3 == 0 ? 'Fizz' : n
)
end
Posted in Ruby |