Andrew Chalkley's (Micro) Blog


Ruby on Rails 3 Public Domain Logo


Rack::ForceIE7

Yesterday I released a piece of rack middleware.

Rack::ForceIE7 is an unobtrusive way of forcing “Compatibility View” on Internet Explorer 8.

Unlike other Rack middleware, instead of injecting a meta tag in the head tag in the body, Rack::ForceIE7 sends a header in the response that tells Internet Explorer 8 to use “Compatibility View” - your response body is not touched, therefore it’s very lightweight and unobtrusive.

I thought I’d develop this to support developers wanting to support multiple versions of Internet Explorer but only use one implementation - or one less implementation/headache if your supporting Internet Explorer 6 as well as 7.

It’s tested too.

Enjoy!


I am doing the Rails Rumble this year!

I am doing the Rails Rumble this year!


Introducing RubyHelpers

I am pleased to announce RubyHelpers gem.

When building lightweight Ruby apps in Sinatra and the like, I often need some extra functionality that Ruby doesn’t have baked in. I end up repeating snippets of code hear and there. I thought I’d bundle it in a gem for my own use and contribute it to the Ruby community.

I have extended Object to include the blank? similar to that found in Rails. For example “”.blank?, nil.blank?, {}.blank?, [].blank? etc

I have extended String to have to_html to use RedCloth to convert textile to (X)HTML. For example “h1. *Hello World*”.to_html would produce “<h1><strong>Hello World</strong></h1>”

I have extended Hash to have dot notation to access values via keys and to have {key}_exists? method too. For example person.first_name instead of person[“first_name”], person.phone_numbers.office person.phone_numbers.mobile_exists?

The Hash extension is really handy after parsing a JSON object. It feels so much nicer to access values via dot notation.

So start using it in your projects:

sudo gem install rubyhelpers

Check out the docs and contribute other RubyHelpers on good old GitHub.


[Flash 9 is required to listen to audio.]

Imogen whispering “birdy”


GMail in Safari 4 not working?

If you find yourself in the situation where GMail in Safari 4 is not working and you have reset Safari and still had no joy then it’s probably because you have Google Gears installed.

It seems that there’s some conflict somewhere so you just need to switch it off in the mean time in your Safari > Google Gears Settings… > mail.google.com> denied.




For those who don&#8217;t know what atheism is&#8230;

For those who don’t know what atheism is…


MacRumors Live Site Hacked

I was watching the feed when the words ”STEVE JOBS JUST DIED : ” appeared amongst other crazy stuff.

People are cruel at times.


14
To Tumblr, Love Metalab