The best thing I've found for distractions is a program called "Concentrate" on OS X. You can set time to block certain classifications of sites, such as social networks. I do the pomodoro technique which is 25 minutes code, 5 minute break alternations. You'd be surprised that you get just about the same amount of HN time in your 5 minute allotments.
I did a blog post about it here: http://jasonseifer.com/2010/02/08/using-concentrate-for-pomo....