There is no getting around it: You will get stuck at an airport at some point in your travels. Instead of throwing a shit fit and kicking the nearest inanimate object, here are a few things you can do to entertain yourself.
Play Airport Gourmet
Use your meal budget to gather random items from airport food places to put together a culinary airport masterpiece. Think Chopped meets Supermarket Sweep. While this isn't a great way to get to know local cuisine (as the airport stocks items aimed at tourists), it does take up an exorbitant amount of time. Start off with finding the perfect appetizer (perhaps a cracker and cheese combo) and move on through desert (you can melt down marshmallows with a lighter to make frosting). It will be gross, delicious and fun.
Carry a Deck of Cards
Other backpackers will most likely be stuck in your vicinity. Find one, whip out your deck of cards and learn a new game. One game OTP learned abroad is Egyptian Rat Screw (from an American but that's not the point). Different countries play interesting card games and later, when you are no longer anxiously awaiting takeoff, you can share your vast knowledge with international hostelmates, maybe add a little booze to the card game, maybe some stripping.
Write About Your Travels
Whether you're travel blogging or just documenting, use this downtime for your advantage while your memory of the recent places you visited is still fresh. If you can get your mind together, you can earn some cash while sitting around at the terminal. Just had a wild night in Rio? Maybe saw something incredible in Dubai? Got arrested in Singapore for smuggling poppy seed bagels (sorry)? People like Nomadic Matt, the writers at Matadorand countless others have cashed in on such experiences. Starting a travel blog (or contributing to an existing one) is a great way to document your travels and maybe even make some beer money. Check out Anil Polat's (the creator of Foxnomad, a very popular travel blog) Travel Blog Advice page to learn how to get started.
Prank Your Travel Partner
This one only applies if you happen to be stuck with a friend (or more likely a person that was a friend at some point but has been sneezing, farting and snoring in your face for a month changing his/her status to annoying acquaintance). This is what you do: go to the bathroom and come out with the look of utter shock. Say you met a guy in there that told you this airport was rigged with hidden CIA cameras, EVERYWHERE and that he said the cameras are watching the two of you specifically. This bathroom guy even told you what you were reading at the newsstand 10 minutes before you had to pee, shocking. Then sit back and watch your travel partner go apeshit with paranoia for hours. Effective, entertaining and nobody gets hurt (physically).
Drink drink drink
We all know time passes gently when booze are involved. The airport is well aware of this and has set up various liquoring holes to numb your waiting pain. While sipping a few brews is fine by us, getting wasted at the airport isn't in your best interest. Sure blacking out would solve the waiting problem but more than anything, it makes you a target for petty theft and a magnet for airport security. Remember that even though you are at the airport, you're still in a different country with varying standards of acceptance in the drunk-in-public department. Relax, just don't be a douche.
FYI, The Best Airport to Be Stuck In...
Consider yourself lucky if you have to spend some time at Hong Kong International Airport. Unlike any other airplane receptacle in the world, this place has a 4D theater, Playstation getaway and an aviation discovery center (where you can pretend to fly a plane in their cockpit simulator). You would have to try really hard to be bored here.
Stuck is a state of mind. Your travels will always come with setbacks. Use this newly freed up time to your advantage.