TMail Moves to GIT

November 23rd, 2008

Social networking here we come!

Read the rest of this entry

Funny...

November 21st, 2008

Some people think that rails is getting bloated… but through the hard efforts of core committers, the fluff and fat is getting sliced and trimmed down like a Döner kebab spit at a turkish festival…

Read the rest of this entry

Terminator - Timeout without Mercy

September 11th, 2008

If you have been following my posts on Ruby-Talk and Ruby on Rails and even RSpec mailing list (and who wouldn’t?! I mean, aside from my mother) then you would have noticed I have been banging my head against a brick wall on the subject of System calls not being handled by the Timeout libraries in Ruby…

Read the rest of this entry

When you are coding, you should try to separate out the things that change from the things that stay the same. This isn’t my idea, but it is worth tip’n here as I just saw a really good, simple example of this…

Read the rest of this entry

Fortune...

July 8th, 2008

I got his when I logged into one of my OpenBSD boxes today. Interestingly true…

Read the rest of this entry

In my previous post (Spec Behaviour not Implementation) I went on a froth roll about why you should treat controller actions as black boxes. Here I give an all to common example of why this is good and how you can write specs that won’t break at the most trivial change.

Read the rest of this entry

This has been said a lot, and doesn’t really need repeating by someone like me, but, as this is a tips page, I should put it here.

Read the rest of this entry

This tip is coming to you from a frustrated developer having to read someone else’s specs….

Read the rest of this entry

You would expect any professional to know their stuff, for a Ruby on Rails beginner, this is no less important.

Read the rest of this entry

Here is how to convert the microsoft way of storing color values (which looks like 16777215 for white) into the familiar RGB CSS style HEX values (which look like #FFFFFF) in Ruby.

1
2
3
4
5
6
7
8
def long_to_rgb_hex_string(val)
  r = "%x" % (val % 256)
  g = "%x" % ((val / 256) % 256)
  b = "%x" % ((val / 65536) % 256)
  "#" + [r,g,b].collect { |c| c.to_s.ljust(2, '0')}.to_s
end

long_to_rgb_hex_string(2093422) # => #6ef11f

Or Grant Hutchins gave this as an option from the comments:

1
2
3
def long_to_rgb_hex_string(val)
  sprintf(’#%06x’, val)
end

Any other good options? :)

blogLater

Mikel

RSpec Story xhr problem

June 6th, 2008

If you are using RSpec stories (and if you are not, why not?) you might run into this little problem. doing an xhr :post returns ArgumentError: wrong number of arguments (4 for 3)

Read the rest of this entry

This tip actually applies to every open source project out there… it is, how do you ask a question that will get you the maximum chance of a good answer?

Read the rest of this entry

When you are making a rails site, you sometimes need to get to the session hash or the params hash and see just what got sent back to the browser, but going in, editing the template and reloading is just a PITA, here is a quick tip that can help you have that (and any other) information no more than a click away, at any time, and any view….

Read the rest of this entry

Even though they got my name wrong :) Gregg Poolak and Jason Seinfield have a fantastic podcast that you all should subscribe to.

Read the rest of this entry

When I was learning Ruby on Rails, this site by Raaum was a god send.

Read the rest of this entry