I'm running on approximately 3 hours of sleep. My hands are shaky. If I sit still for too long I run the risk of falling back asleep. I've done all nighters before so I have my routine and tools to fall back on, I'm just curious how other hackers do it.
Coffee? Teas? Energy drinks? Sleep?
Then you're doing something wrong. The way you manage your time? The way you approach your subject? The way you organize your work? The way you set priorities?
An all-nighter is not a badge of honor. It's a sign of poor work habits earlier in the cycle. Find the cause of your need to do all-nighters, eliminate it, and don't do them any more. (And probably get twice as much work done during the day.)