Out of curiosity, have you tried to drink large amounts of water when you feel like it?
I've noticed that drinking 3 large glasses (about 1.5 quarts) of water when foggy often helps me concentrate again.
Supposedly even a moderate level of dehydration has quite a large impairment on basic metabolic processes. It's entirely possible that, in some cases, drinking extra water would improve cognition generally.
This paper (PDF)1 looks more than a little interesting:
I find this interesting, in that the days I get less work done (due to e.g. spending more time on Less Wrong) are often days when I don't eat breakfast right away, and am generally undereating (like today).
References
1. Matthew T. Gailliot, Roy F. Baumeister. (2007) The Physiology of Willpower: Linking Blood Glucose to Self-Control. Personality and Social Psychology Review, Vol. 11, No. 4, 303-327