My way was to find maintenance contract where I do programming few hours a week that pays my bills and mortgage + occasionally taking some contract work (about once a year, month - three months long).
Contracts could be very stressful (as I am usually picking on some VC type of startup as they use to pay more), but I know it is going to be over soon so it is easy to just go through it.
I am doing that for more then a decade and it works, the only thing is to figure out what you are going to do with your off time: I used to start startups, side projects, travel the world, but for past few years I am just farming and spending time with my kid.
More people should really think about this alternative.