Life on Rails » Technological travels in Flex, Air, RIA and life in general
Imagine a beautiful autumn park, and a bald ginger man reading books and playing guitar, and doing other stuff

Ruby is... Java is...

Tags: ,

I don’t want to be a hater, but I’ve been doing Java recently, quite intensively, after doing a bunch of rails. Well, the other day I was on irc, talking to someone about my experiences, and this kinda fell out, and I like it, so here it is:

ruby is like, how shall I put it..? It reminds me of being in Cornwnall or a Spanish city

Java reminds me of being in London

...in the square mile

....at rush hour

Blocking IP addresses in rails

I’ve been moving visualchat.co.uk to ruby on rails recently and one of the things they have to do is block certain ip addresses, in fact, entire ranges of ip addresses, as they get a lot of naughty mischievous chilldren (read as fucktards) creating havoc.

I tinkered about a bit and then asked on #ruby-lang where one David Black answered the call. The code he gave me is my favourite bit of ruby code ever. I think his solution is so very nice it’s unbelievable.

More...

Dynamic class instantiation in Ruby

Tags:

I’s on #rubyonrails the other day when someone asked: how do I tidy this up?

  1. def Creation.make(raw, content_type)
  2. if Movie::MIME_TYPES.include?(content_type)
  3. Movie.new(raw)
  4. elsif Music::MIME_TYPES.include?(content_type)
  5. Music.new(raw)
  6. elsif Picture::MIME_TYPES.include?(content_type)
  7. Picture.new(raw)
  8. elsif Fiction::MIME_TYPES.include?(content_type)
  9. Fiction.new(raw)
  10. else
  11. Creation.new(raw)
  12. end
  13. end
More...

Some things I love about ruby

Tags:

Last year (2006) I had some ideas for a couple of websites I really wanted to make.. I had to get some funding together (to pay for food+rent while I coded) and as such, had to write a plan which I could give to money people, to make money decisions.

Part of that involved looking into the technologies in which I’d make my amazing sites. At the time I was a .net developer and was originally going to go down that route.. I was pricing up servers, work estimates, software (18k for sql server!! WTF?!) and eventually worked out I’d need about 100k to do this..

More...