(This article mentions that not only are cell phones banned at the featured school, but these kids have hobbled laptops that supposedly help them focus on school work, although the imperfect nature of the hobbling has unintended consequences).
1. I use an app called SelfControl, which blocks websites temporarily.
2. I have a script which watches `/etc/hosts` with launchd and reverts it to a version pulled from a server if the file changes. This blocks websites I never want to go to.
3. I setup a 'focus mode' with hammerspoon prevents me from launching certain apps, and makes me wait 30 seconds and type a string of text when I want to switch it off.
Yes, all of these things can be disabled when I want to, but the point is that they all add some fiction and give me a chance the reconsider the distracting action I was about to take.
I've been doing it for about 2 weeks, so far it's working pretty well!
Another thing that helps is recording your screen for the whole day. Once you start doing review in the evening it will create back-pressure on the monkey brain that jumps to distractions.
Yet another thing is to setup a separate computer. You can browse crapnet as long as you want, but you have to walk to another desk. The back pressure is subtle but has long-term effect and requires very kittke will power.
Yes, I got as far as creating a separate account on my MBP a few years ago and I do programming and open source stuff with that account. And it has helped quite a bit! Although it's not perfect (case in point, I am here on HN right now).
The laptop would come with a study mode button.
You would push it and turn off distractions.
Then 5 minutes later you would disable it just to send a chat.
Then since it was off, you'd just quickly check TikTok.
Then while you're at it, it just a quick break, you'd pop over to Twitch.
3 hours later...
If you can't teach yourself restraint, a button won't help.