upvote
A combination of https://selfcontrolapp.com/ and Hammerspoon automation and you can lock yourself out of pretty much everything.
reply
I managed to build myself exactly this with Claude's help. There are 3 levels of protection.

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!

reply
Create a separate Mac / Windows non-admin account just for coding? I’m sure there are parental control measures for either platform. As time goes you can update the deny list of web sites.

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.

reply
>Create a separate Mac / Windows non-admin account just for coding?

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).

reply
Here is how it would work in real life:

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.

reply
That’s a very simplistic view.

Granted it won’t work for 100% of people but I’m sure it would work for lots of people.

Something as simple as a button you have to press to disable it is often enough of a barrier to prevent people from doing that as it makes the context switch from work to non-work more obvious than simply alt-tabbing to a different browser window.

reply
Slowing down the dopamine feedback loop works. Many impulses that lead to distraction are automatic, not conscious. Ever closed a Hacker News tab just for your fingers to immediately re-type the URL into the bar and hit enter? There are browser extensions that delay loading pages on a given site for a number of seconds, to cut off that sort of automatic behavior, and they work as long as the delay to load the site is less than the time and effort it takes to open up your addons manager and disable the addon.
reply