I’ve discovered naps a few years ago. Or perhaps I’ve rediscovered them, since it is likely I napped as a child. If I find myself dozing off in front of the computer, I find that it is better to just take a quick nap than force myself to work through the sleepiness. I set an alarm so that I don’t nap for more than 30 minutes. It often happens that after about 20 minutes I find myself refreshed and can resume working.