I have a new habit that I enjoy, even though I am certain it is getting on the nerves of my colleagues.
Whenever I find a bug in a piece of logic I've written -- whenever I find I've used || instead of && or left out a !, I shake my fist at the sky and shout, at the top of lungs, "Damn you George Boole!"
Try it. Very therapeutic.
(actually I kind of whisper it under my breath most of the time)