SelfControl is a free and open-source application for Mac OS X that lets you block your own access to distracting websites, your mail servers, or anything else on the Internet. Just set a period of time to block for, add sites to your blacklist, and click “Start.” Until that timer expires, you will be unable to access those sites–even if you restart your computer or delete the application.
This app has been installed in my Mac’s since forever. On some weeks/projects it’s really hard to fight the impulse to hit
⌘ + tab and do anything but what you need to do.
SelfControl is tough medicine for this1.