For a week this worked pretty well for me:
Start coding and once you get bored and notice you can't longer keep going, close your IDE and play Mount & Blade Warband on the hardest settings (except for the "only save on exit" option which is the path to madness).
Try to win a tournament with a level 5 (or less) character until you notice you're frustrated enough and can't play any longer, then launch the IDE again and start coding again.
Repeat until you die of exhaustion... Or you win the tournament (probably you will die of exhaustion though).