jlaine.net

Ruby/Rails Class in Helsinki in May

I will give the first-ever open Finnish Ruby/Rails class May 8-11 in Helsinki. The class will have 4 intensive days of learning (2 for Ruby and 2 for Rails) the basics of the #1 technology to know in 2007.

The class will be very affordable (€500 + 22% VAT) to make it possible for even freelancers and small business employees to get comfortable with Ruby and Rails. The seats are very limited (only 10 slots sold openly), so be quick or prepare to wait for the next opportunity.

Read the more detailed Finnish d€ion of the class on rubyonrails.fi.

New on dotherightthing.com: Atom Feeds

We just went live with a three week tuneup at dotherightthing.com. The main update is the introduction of a wide variety of Atom feeds. I just wrote an “in-depth article about all the different feeds available on the dotherighthing.com blog”:, but let me get a bit more geeky here.

We’re using Ruby on Rails and the Simply Restful stuff in it so adding an Atom representation for a resource like entry, company or user is dead simple: just add a new response type with respond_to:

  respond_to do |type|
    type.html do
      # normal stuff
    end
    type.atom do
      # render the atom feed
    end
  end

Now, when someone requests the action with type atom (e.g. http://dotherightthing.com/companies/starbucks.atom), the code inside type.atom will be executed. However, the niceties don’t stop there. The new resource_feeder plugin makes everything even easier. We don’t need to setup a specific template for the feeds at all, all we have to do is to specify some options that don’t match the standard and then call render_atom_feed_for:

  feed_options = { :feed => 
                      {:title => "dotherightthing.com #{params[:sort]} entries",
                       :link => entries_url(:sort => params[:sort])},
                   :item => {:description => :body_html},
                   :class => Entry }

                   ...

  type.atom do
    render_atom_feed_for(@entries, feed_options)
  end

And that’s it!

Another great thing about Simply Restful is that all the url’s are extremely logical. A user profile can be viewed at http://dotherightthing.com/users/jarkko, a feed for his content is at http://dotherightthing.com/users/jarkko.atom. The same is true for companies: http://dotherightthing.com/companies/apple → http://dotherightthing.com/companies/apple.atom.

Gotta love the RESTful features in Rails!

Don’t forget to check out the variety of feeds we offer at dotherightthing.com.

Hippy Hippy Gem

A Ruby/Rails meme! Mike started and Robby followed up, so here you go:

$ gem list|grep '^[a-zA-Z]'
action_profiler (1.0.0)
actionmailer (1.3.2, 1.3.1, 1.2.5.5618, 1.2.5)
actionpack (1.13.2, 1.13.1, 1.12.5.5618, 1.12.5)
actionwebservice (1.2.2, 1.2.1, 1.1.6.5618, 1.1.6)
activerecord (1.15.2, 1.15.1, 1.14.4.5618, 1.14.4)
activesupport (1.4.1, 1.4.0, 1.3.1.5618, 1.3.1)
acts_as_taggable (2.0.2)
aws-s3 (0.2.1)
betabrite (0.0.2)
builder (2.0.0)
cached_model (1.2.1)
capistrano (1.3.1, 1.2.0)
cgi_multipart_eof_fix (1.0.0)
cheat (1.2.1)
daemons (1.0.4, 1.0.1)
deprec (1.2.1)
facets (1.7.46)
fastthread (0.6.2, 0.6.1, 0.5.3.1)
ferret (0.10.9)
flexmock (0.4.3)
gem_plugin (0.2.2, 0.2.1)
gettext (1.8.0)
gruff (0.2.8, 0.2.4)
heckle (1.1.1, 1.1.0)
hoe (1.1.6, 1.0.4)
io-reactor (0.05)
memcache-client (1.1.0)
mime-types (1.15)
mocha (0.3.3, 0.3.2)
money (1.7.1)
mongrel (1.0, 0.3.14, 0.3.13.4)
mongrel_cluster (0.2.1, 0.2.0)
mysql (2.7)
needle (1.3.0)
net-sftp (1.1.0)
net-ssh (1.0.10)
ParseTree (1.6.2)
payment (1.0.1)
piston (1.3.0, 1.1.1)
production_log_analyzer (1.3.0)
rails (1.2.2, 1.2.1, 1.1.6.5618, 1.1.6)
rails_analyzer_tools (1.1.0)
railsmachine (0.1.1)
rake (0.7.1)
rcov (0.7.0.1)
RedCloth (3.0.4)
rmagick (1.14.1)
Ruby-MemCache (0.0.1)
ruby2ruby (1.1.2)
rubyforge (0.3.2, 0.2.2)
RubyInline (3.6.2)
selenium (0.7)
shipping (1.3.0)
sources (0.0.1)
sqlite-ruby (2.2.3)
sqlite3-ruby (1.1.0)
tddmate (0.1)
termios (0.9.4)
tidy (1.1.2)
tzinfo (0.3.2)
xml-simple (1.0.10)
ZenTest (3.4.2)

I still curse the day I had to reinstall gems and lost my Rails versions around 0.3.

Form and Function

My new Mirra

After our trip to Paris and EuroCabooseConf I brought home my new office chair, a Herman Miller Mirra. I’ve been looking for a good chair for quite a while, but have been postponing the purchase because of the low availability. In Finland you basically have to travel to Helsinki if you have to test drive anything more obscure than a very basic office chair.

After giving a workshop in Helsinki last week I finally took the plunge and went to visit the only HM representative in Finland. And boy was I sold.

Mirra has been on the top of my list for several reasons:

  • It is a lot easier to adjust than Aeron and fits most people by default.
  • It costs only about 2/3 of the price of Aeron (or Freedom Chair, which has even worse sales network in Finland).
  • It is, according to Bill McDonough (the author of Cradle to Cradle), “the most advanced and thorough application of Cradle-to-Cradle principles a furniture maker has ever brought to the market.”

After testing the chair the deal was pretty much done. Mirra is plain and simple the best chair I’ve ever used. It offers just the right amount of support and free movement you’ll need if you have to spend hours each day sitting in one place.

New chair

But Mirra is not just a great chair. By buying it I also felt like doing the right thing. The initial four aspects we had when building dotherightthing.com were customer, community, employees and environment. I feel that Herman Miller takes all these four aspects into account in its business, maybe better than any other company.

Good things for me as a customer:

  • I got the best chair I’ve ever used.
  • Mirra is an extremely low-emitting product, meeting the GREENGUARD^TM^ standards. This results in better indoor air quality.
  • Mirra is of really high quality (“Number One design and environmental criteria: Durability.”) and equipped with a 12-year warranty, work included.

Good things for the environment in general (some highlights from the Mirra Environmental Product Summary):

  • The Mirra chair is up to 96 percent recyclable at the end of its useful life.
  • Mirra is comprised of 42 percent recycled materials.
  • Every material has been scrutinized down to the molecular level.
  • Steel components can be segregated and returned to the recycling stream as a technical nutrient.
  • No polyvinyl chloride (PVC) used; thermoplastic elastimer is used for arm skin.
  • Molded polymer back can be recycled up to 25 times.

New chair

  • …and much more, see the summary for details. Following the Cradle to Cradle approach, Mirra is designed from the ground-up not to be less bad for the environment, but rather eliminate the bad side effects.

Good things for the environment, employees and the local community around the factory:

“The GreenHouse” provides an urbane, pleasant environment for all employees; copious fresh air and sunlight; easy access between administrative and manufacturing staff; and natural features such as wetlands and swales that purify storm water run-off and provide habitat for local birds, flowers, and grasses. The result: a measured increase in productivity, a measured increase in the degree of job satisfaction, and a measured array of positive social and ecological impacts. In fact, the building won Business Week’s first “Good Design is Good Business” award for its documented impacts on the top and bottom line.

New chair

If you find this story important, go ahead and rate its impact on dotherightthing.com.

dotherightthing.com Is Live

[UPDATE] Should have knocked the wood a few times more. We were on Kottke and TechCrunch just about the same time, and man, that shows. A new server is on its way, but before that, please bare with us.

Almost forgot to blog about this in the heat of everything: we’re live!

It’s a terrific feeling, to see something you built in real use. I’m very happy and proud for the whole team. Thanks guys!

It’s nice to see that after the initial shyness people have started posting their own stories, too. We were also mentioned yesterday in Treehugger and got hugg. Those created some nice traffic but we’re still waiting for the big hit to come, though, so fingers crossed the system won’t melt down.

If you haven’t yet visited the site, check it out. I personally feel it has a huge potential to be the place where people go before purchasing stuff to see how the seller or producer treats its customers, employees, environment and the community. Our goal is also to get companies to participate in the discussion, in a true cluetrain fashion. And the more people participate, the more useful the site is for everyone. And the sooner to sign up, the bigger chance you have to grab a really cool username ;-)

When the situation cools down a bit, I will start a series of articles about the technology and other background details behind the site. So stay tuned!

Hidden CSS Stuff: The Outline Property

Anyone worth calling herself a web developer has probably used some kind of an image replacement technique during her career. You know, replacing a page header text with an image, still keeping the HTML structure semantic and accessible.

One of the most common image replacement technique is called the Revised Phark technique, named after Mike «Phark» Rundle. The idea of the technique is that using the text-indent CSS property the heading text is placed so far away from the visible area that it is never shown:

#replace {
  text-indent: -5000px;
  background: url(/background.png) 0 0 no-repeat;
}

The good thing about this technique is that it doesn’t require any extraneous elements to get the effect, thus making it very straight-forward and easy to grasp. On the other hand, it doesn’t work for the odd people that keep CSS on but images off. I can’t think of a reason to do that (except for mobile browsers but they can be treated with a separate stylesheet), so I wouldn’t consider it a big issue.

However, there is an annoying issue if you use use the Phark technique with an anchor element, something you very often do with the main page header. When you click on the link, it will have a dotted narrow border that will go on to the edge of the screen:

Outline issue with the Phark method

A few days ago I was reading Andy Clarke’s excellent Transcending CSS and on page 279 it mentioned the outline CSS property of which I’d never heard. I wasn’t very impressed about its usefulness, but somehow it got me thinking. What if that’s the blot on the Phark landscape? And lo and behold, it was!

Just by adding

  outline: 0;

to the css rule used for the image replacement fixed it. No more those “What the hell is there on the left where I can’t get?” moments on my pages.