Archive for the ‘Uncategorized’ Category

A New Gem For People Who Can’t Use HTTP Methods Other Than POST

Tuesday, September 28th, 2010

Itch:

I needed to be able to look at query params in the URL for the _method parameter Rails uses to fake different types of POST-like requests. Rails currently doesn’t do this for you as it uses Rack::MethodOverride, and that doesn’t look at GET parameters. It only looks at the X-Http-Method-Override header and POST form params. Some Rails users filed a ticket awhile ago about it, and it is an ongoing concern(see #2289).

Scratch:

Being a go getter, active, knows his way around a gemspec sort of person, I whipped up a library so if you run into this problem, you can fix it easily. Rack::MethodOverrideWithParams is the result. It is a drop-in replacement for Rack::MethodOverride, so all you have to do is replace Rack::MethodOverride in your stack with it and you’ll be rocking query param method overriding goodness.

“How easily”, you might ask. Let me show you. It’s just a couple of code additions:
Gemfile
gem "rack-methodoverride-with-params", "~> 1"
config/environment.rb
config.middleware.swap Rack::MethodOverride, Rack::MethodOverrideWithParams

Done.

What do you think?

Links

github.com/baroquebobcat/rack-methodoverride-with-params

rubygems.org/gems/rack-methodoverride-with-params

Rails ticket #2289

Twitter API + rest_client == Awesome

Thursday, January 28th, 2010

I was catching up on my tweets last night, when I saw this tweet and thought to myself, “Hey, that should be easy to do with rest_client


So I dove into the Twitter API docs and found the pages on creating friendships and reading list members.

I then looked at rest_client’s documentation to see how best to manage the basic auth login, etc and decided to use RestClient::Resource, since it stores some of the config data for you., even though it makes things more complicatted due to needing two separate resources — one for api.twitter.com and one for twitter.com.

It took me ten minutes or so to put it together and test to make sure I didn’t make any stupid mistakes. Cool?

Winter Cooking

Thursday, January 28th, 2010

While I was home for Christmas & New Years I cooked up some tasty stuff.

Chicago Deep Dish PizzaCooks Illustrated recipe(requires registration, but totally worth it.)

Pizza Detail

Apple Turnovers — Again a Cooks Illustrated recipe, this time from the America’s Test Kitchen Family Cookbook.

Turnovers Detail

Broiled Salmon — I don’t remember, but I think this mostly came from the America’s Test Kitchen Cookbook, except the mushrooms.

Broiled Salmon

Okonomiyaki(wiki), Hiroshima style(お好み焼き) — Hiroshima style means it has ramen and a fried egg.

Okonomiyaki V: Done (お好み焼き)

My First Arduino Sketch

Saturday, November 21st, 2009

I got my arduino and chumby guts from makershed.com this week.

Arduino and Chumby Guts Boxen

I unboxed them and thought about what to do with them.
Chumby Guts

My chumby guts needs an enclosure, something I am going to wait until I have access to power tools perhaps.

But the arduino provided immediate gratification. Who knew embedded programming could be so easy.

My first arduino sketch (can you guess what it says?):

On Conductors and Directors

Monday, November 9th, 2009

This reminded me of all the time I spent in Howard Hall, practicing music and listening to music majors talk about their work.

When Unsure, Food Pics Post

Tuesday, October 27th, 2009

Behold yonder food.

Click on them for more info, some even have descriptions. Also, flickr is awesome

Udon in Cool Bowls

Local Brat Sammich

Sara Made Bread

From Frozen Stir Fry

Miso Soup

Gumbo, Zatarains+

Falafel Wrap

Windy City Rails

Saturday, September 12th, 2009

I’m going to Windy City Rails today. It should be fun.

WindyCityRails - September 12, 2009 - Attendee

Methusela’s Children

Monday, July 27th, 2009

Reading this post by Charles Stross reminded me of a TED talk I saw a few years ago.

 

Thinking about these sort of things also reminds me of some of the Heinlein I read when I was in middle school and high school. Lazarus  Long is a fascinating character. I remember wondering what it would be like to live so long. I find myself continually amazed reading and listening to people talking about the possibilities that advances in medical science could create.

RubyNation

Sunday, June 7th, 2009

Check it out. I am going to rubynation this week(this week since it is already sunday here). I plan on writing up my conf notes here afterwards, but we will see how it goes. I am looking forward to it. It the first time I have been in/around DC since I was in middle school. Ah, that was a fun trip.

As my first non Mountain West Ruby Conf, it should give me a chance to see some of the differences between regional conferences. On the other hand, some of it will be very much the same.(Herding Tigers)



Moved to Disqus Comments

Friday, May 29th, 2009

I changed my comment system over. Got tired of dealing with spam.