a Good day

Posted by clint

Jeremy said it well.

http://jthopple.com/2007/2/27/a-good-day

Damn, Ruby is sweet!

Posted by clint

Every once in a while i write some code that puts a smile on my face and makes me say, out-loud, "Damn, Ruby is sweet!"

Today's scenario: I'm writing some software that will run a gear review website, much like mtbr.com. No one wants to add all of those items by hand. So we're getting manufacturers to supply csv files that specify their products. One of the columns is :image_url.

We keep our images in the db and don't want to rely on external images... I wonder how hard it'd be to use that image_url to grab a copy of the image, resize it, and stick it in the db? turns out it's not that hard.

open @product.image_url do |file| image = MiniMagick::Image.from_blob(file.read) image.resize(Picture::MAX_SIZE) @picture = Picture.create({:data => image.to_blob, :title => @product.name, :width => image[:width], :height => image[:height], :format => image[:format]}) end

leaving sensitive info out of your capistrano deployment

Posted by clint

Don't tell anyone, but I have a hard time worrying about security. Recently a client asked that I take all sensitive info out of our svn repo. That includes database.yml, mongrel_cluster.yml, and deploy.rb. Deploy.rb is easy enough. if you don't ever set your passwords: set :password, "double_secret" Capistrano will prompt you for them. For your other config files you need to be a little more clever. Create a directory named config on your deployment machine at shared/config. Create a copy of your datbase.yml there named database.yml.production. Next, add the following to your deployment script: desc "Runs after svn up. Use to copy sensitive information out of shared/config" task :after_code_update, :roles => :app do db_config = "#{shared_path}/config/database.yml.production" run "cp #{db_config} #{release_path}/config/database.yml" end

CD Stuck in Macbook Pro

Posted by clint

I got a cd with a paper label stuck in my computer last night. I spent four hours fiddling around with knives, tweezers, credit cards, tape—everything i dug up on google. No Help.

I sleep in the basement, and it’s fairly arctic down there. I put my computer downstairs while I slept last night and it got nice and cold—this morning the cd ejected on the first try.

Lots of things expand a bit when they’re hot—CD’s too? ... Maybe?

Fedora Core 5 and Ruby on Rails Server Recipe

Posted by clint

Hosting rails apps on a shared server is a pain in the ass. We've tried both dreamhost and textdrive. The problems are the same no matter where you go -- performance isn't good and you're not in control of your environment. We decided to start paying for a dedicated server from cari.net. Cari.net's prices seem fair and their support has been incredible.

I'm sure there are improvements to be made -- but this should at least serve as a really good start.

btw: most of the credit for this recipe goes to jeremy at jthopple.com

Extra complexity for extra functionality

Posted by clint

Today I emailed a friend of mine from Australia that I’d lost contact with. During our email conversation I was thinking about the things that I liked in Australia. Near the top of my list is their toilets.

People talk a lot about wasting water—and water conservation is definitely a good thing. I wonder how much wasted water we flush down the toilets?

In America we’ve combatted the toilet-water-waste problem by making toilets that flush less water every time. 1.0 gallon per flush. Now, 1.0 gpf is a good idea— but how many times have you used a 1.0 gpf toilet that didn’t really do the job? In Australia they’ve solved the problem with more complexity and more functionality. I think it’s a good solution.

In OZ they have two buttons on each of their toilets. One half flush, one full flush. Pretty obvious what they’re for. The extra complexity is worth the extra functionality, and you end up with a product that performs better in every way: it’s more powerful when it needs to be more powerful and it conserves when it makes sense to conserve.

Nintendo gets real

Posted by clint

Sounds like Shigeru Miyamoto has been reading SVN.

A few snips from Time Magazine’s exclusive interview with Shigeru concerning the new Nintendo wii:

Building Products You’ll use:

Animal Crossing wasn’t originally designed for girls. “Many female schoolchildren are purchasing and enjoying it,” [Miyamoto] says, cracking himself up. “Also ladies in their 20s. But the fact of the matter is, this game was developed by middle-aged guys in their 30s and 40s. They just wanted to create something to play themselves.” – Time

We are users of our products. We build products for ourselves. We’re not special so we know that if we find the products useful then hundreds of thousands (or millions) of others will as well. – Jason Fried

Saying No

Nintendo has grasped two important notions that have eluded its competitors. The first is, Don’t listen to your customers. The hard-core gaming community is extremely vocal-they blog a lot-but if Nintendo kept listening to them, hard-core gamers would be the only audience it ever had. “[Wii] was unimaginable for them,” Iwata says. “And because it was unimaginable, they could not say that they wanted it. If you are simply listening to requests from the customer, you can satisfy their needs, but you can never surprise them. Sony and Microsoft make daily-necessity kinds of things. They have to listen to the needs of the customers and try to comply with their requests. That kind of approach has been deeply ingrained in their minds.” -Time

37s thinks No is a good idea too

Design vs Technology

And here’s the second notion: Cutting-edge design has become more important than cutting-edge technology. There is a persistent belief among engineers that consumers want more power and more features. That is incorrect. Look at Apple’s iPod, a device that didn’t and doesn’t do much more than the competition. It won because it’s easier, and sexier, to use. In many ways, Nintendo is the Apple of the gaming world, and it’s betting its future on the same wisdom. – Time

37 has done a lot of preaching about Less Technology

It’ll be interesting to see if Getting Real works for Nintendo. With rumors of the wii selling for $249 It’s safe to say I’m on board.