It was probably Jerry Barber. Cite: http://quoteinvestigator.com/2010/07/14/luck/
"Chance favors the prepared mind." - Louis Pasteur
This video by GitHub founder Tom Preston-Werner is directly relevant: http://www.justin.tv/c3oorg/b/272031754
A big theme in his talk is how to engineer your luck.
That reminds me of a story where a professional golfer took a year off for practicing, no tournaments or other distractions. After that, on his first tournament he started with hole-in-one.
A journalist asked him "surely that must have been luck? Nobody can reliably train a hole-in one", upon which the golfer answered "Yes, it was luck. But the more I train, the luckier I get".
I always loved this answer, because it contains a deep truth: must people who seem to be "lucky" really worked hard, and then had luck too. None of our rich programming idols seems lazy to me.
P.S. I have no idea if the story with the golfer actually happened, or if it's fiction; I can't remember any sources.