Calvin Coolidge
In my experience, a smart person can do well without much work; a hard worker can do well without being particularly smart; but only a combination of the two, and other qualities besides, leads to anything truly interesting.
But when I'm just working on it myself, for myself, and not interacting with others about it, I find it's best just to free-form it.
Hmm, as a programmer who works for a salary, I think it is a very important skill to know when to quit the circumstances which are stopping you from being happy with your daily work.
You can be extremely spirited and self-motivated, but many things will gnaw away at your core. A micromanaging boss who thinks programming is easy (because he did it a decade ago), an office environment where you are regularly entangled in poisonous politics, or people who plain demotivate you.
When it is time to go, it is time to go. :)
I love the projects I'm working in SV as a startup designer but sometimes I look at how life would be if I moved back from SF to all the amenities I have back in my hometown (properties, good longtime friends, less stress).