So luckily I only wasted 30 minutes this time solving a bug where it turns out I did a - b instead of a + b (and fixed some other minor bugs while trying to find the root cause). Also note the repeated y's...
I've made too many dumb mistakes to remember any individual one, I just vaguely recall many face palms in my past. A new habit I've formed, however, is leaving notes in the comments to my future self when I write potentially dubious code, usually saying something along the lines of "if this stopped working, it's most likely because of this line/function/etc." This has actually proven to be quite helpful as it has saved me good amounts of time on multiple occasions now.
I'm not sure how good of a practice it may be considered, but I'm not the only one that does it. Obligatory xkcd: http://xkcd.com/1421/
Yesterday I was working on the back end for a ticket system I'm making for work, the tables get created by the php code, and some of them are populated automatically with some hard coded values- I have been creating and dropping the tables frequently because of the many changes I've made to the structure of the database recently.
Little did I realize every time I recreated those tables I was actually duplicating all of the default values so when I was working in the front end and made a bunch of new tickets, the associated programIDs were actually like 90 instead of 6! I fixed it by giving those program rows manual values, but now I have a bunch of orphaned tickets just floating around ^_^