Getting into a place where Internet connectivity is either not available or is very spotty helps. I've done some of my best programming in trains.
Sure, not having access to documentation sucks, but not having access to HN and Twitter compensates for it well :-)