No, I keep two completely separate laptops... one for work, one for personal. On the work laptop, I do not do a single task that is not work-related. When I want a break, I switch to the personal laptop. It does take some discipline, but after a while it becomes second nature. You end up in a place where there are no distractions, only deliberate choices to either work or play.
Having two distinct physical devices makes it much easier to avoid distractions. I have never accessed Hackernews, YouTube, etc on my work machine and never will.