Whenever I eat something unplanned at work, I immediately send my personal email account a quick note describing what I ate. It could be as small as two chocolate Easter eggs, or as big as a slice of cake (odd that it's never vegetables!). When I get home, I enter it into my nutrition tracker.
This keeps me from forgetting to record small nibbles here and there into my nutrition tracker. Sometimes, it's the small things that add the most calories (those two chocolate Easter eggs totalled more than 100 calories!).