I used to do work on Caltrain, which used to be like 3 hours of my commute and didn't have any internet, so I would carefully plan what I could do beforehand. My code deploys to a machine that's very different from my laptop, but I had a Docker container set up to cross compile things and loaded up the docs beforehand, so as long as I planned out what I wanted to do.
These days Caltrain is faster and has occasionally frustrating, but fairly good Wi-Fi, so now my constraints are that I don't have a large monitor but not really much else.
I take the non-express in the morning and express in the evening, which used to be 105 and 60 minutes respectively prior to electrification. Nowadays it's 75 and 60 which is a little more reasonable. I could in theory take the last express in the morning but I think trying to squeeze in on a packed train that I have to wake up early for isn't really worth it over being able to leave the house at 10 and being guaranteed a table.
These days Caltrain is faster and has occasionally frustrating, but fairly good Wi-Fi, so now my constraints are that I don't have a large monitor but not really much else.