Not that it's a habit, but still, here are some tips......
i guess you got a office or at least a cubicle cause these don't work in a open desk-yard.
-get some paperclips and trow them on the floor, get down on the floor and make sure you're leg is against the door (so you wake up if anyone comes in), use the excuse that you where picking up the 'dropped' paperclips for being down on the floor.
-drop a pen or a note on the ground under your desk. Next, rest your head on your desk (eyes facing the ground) and let your arm dangle down over the pen or whatever you dropped, to someone passing by it looks like you're trying to pick up whatever is on the floor.
-if the company is big enough you might get away with announcing to whoever is listening that your off to a meeting, lock yourself in somewhere (your office, the supply room, toilet,...) and take your nap there
-get some code on your screen (unless there is someone who actually knows code it doesn't matter what, i suggest the source code of this page and stare at it.. if someone interrupts you mumble something while waking up and then get mad at him because you lost track of whatever problem you where trying to find.
-open up your pc, get under your desk, unplug a load of things, make sure you make a 'moat' using parts and cables so nobody can get to close, then get down on the floor behind your pc, fall asleep, and if someone find you, explain that your where looking where you needed to plug that cable in...
-expierience (bubble wrap makes a nice mattras by the way if your doing an inventory count...)