I get this sometimes. For me, it takes the right balance of something I'm excited about, having a lot to learn, and having drive from people whom I feel are pushing me in a direction that's better when I'm having trouble ramping up, but not in the way when I'm really rolling out code.
I've been doing most of that lately, though I can get into a dream state quite a bit where I want to make something really awesome that will slow things down a bit too far.