ForĀ OS X, there is SelfControl which can make it so you cannot go specific websites (which you specify) for certain amount of time (which you also specify). The program's great for productivity... unfortunately, if I don't go to my favorite websites, I always end up playing games, specifically Starcraft 2.
Is there any program or code to block myself from playing this game for a given amount of time?