I would partly agree with this, you dont function well on little sleep, but its affects everyone differently.
Diet and exercise are also important.
Today I have a bad headache, I was woken at about 5am and not long after that it started and working (using computers) has made it worse.
Unfortunately its a bit too early where I am to start hitting the bottle, so I'll just have to ride this one out! - but back when my migranes were almost daily I stopped drinking instant corffee and switched to real filter coffee and I would also drink single malt whisky (more coffee than whisky and obviously not at the same time!) and things got better for me....
But then more reently I've also tried not drinking coffee / alcohol and its made no difference to things.