TMail Moves to GIT
November 23rd, 2008
Social networking here we come!
Read the rest of this entryFunny...
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 entryTerminator - 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 entryWhen 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 entryFortune...
July 8th, 2008
I got his when I logged into one of my OpenBSD boxes today. Interestingly true…
Read the rest of this entryExamples of Behaviour Spec'n
June 30th, 2008
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 entryTip #27 - Spec a Behaviour, Not an Implementation
June 28th, 2008
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 entryTip #24 - Being clever in specs is for dummies
June 25th, 2008
This tip is coming to you from a frustrated developer having to read someone else’s specs….
Read the rest of this entryTip #23 - Know your fundamentals
June 21st, 2008
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 entryHere 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 entryTip #22 - How to ask a question about Rails
June 5th, 2008
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 entryTip #21 - Developer Info On Every Page
June 4th, 2008
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 entryTip #20 - Subscribe to Rails Envy
May 28th, 2008
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 entryTip #19 - Raaums Hints Rock
May 27th, 2008
When I was learning Ruby on Rails, this site by Raaum was a god send.
Read the rest of this entry