You find something to entertain you, You make sure you don't get bored because once you get bored you will most likely fall asleep. I stay up on a regular basis to finish all my homework and such so it is possible to stay up doing boring things like math, literature, science, but it is easier to do so with something fun to do, like video games and things like that. But you will be feeling that lack of sleep later on during the next day trust me it comes around and gets you some how.
Keep your brain active. Do something you enjoy, something that keeps your eyes open, like go on the computer & play games, video games, watch your favourite tv show, build something, even try to figure out a new feature on something. I personally stay awake late because I work on features on my computer or iPod sometimes.
I'm adicted to the computer once at summer I stayed woke at 3 days in a row