First, there will always be dickhead customers. I always used to get mad at them and suffer through it, but I've since found ways to deal. It helps to complain to my coworkers and come up with sarcastically funny things to say. Even to the customer, as long as it's sarcasm with a smile they probably won't understand.
Actually, a funny thing we've taken to experimenting with is being overly nice to the mean ones. 100% of the time that I've been enthusiastically nice to someone who was previously being mean (I don't mean acting like a dirt-licking pushover, just trying to 'fix' their situation) it's resulted in them stopping. Most of the time it makes them apologize and feel bad about what they've done.
Also, we've learned that if you AGREE with them, they have no room to complain anymore, so they stop. Like this situation:
Customer: "You guys are ALWAYS out of those Bliss bars when I come in. This is ridiculous!"
Me: "Oh my gosh, I know! I never get them either because they run out before I can buy one too!"
Customer: "Er.. well.. yeah. Are you guys going to be ordering more?"
Me: "I hope so!"
Customer: "Okay.. thanks.."
I like confusing customers when they are angry :D
It's also actually really surprising what a smile can do. Some people are so caught up in their own bad moods that they don't realize they are being dickish to someone undeserving. Imagine if YOU've had a rough day, then try to make yourself feel better getting coffee or taco bell or cookies, or whatever, and they are out of something or slow or mess your order up. You'd be upset too. Sometimes people (employees and customers both) need to learn a little bit of understanding.