Our solution is that I go to bed at 8pm and get up at 4am and work like mad until breakfast which is around 9am. Thats 5h of uninterrupted coding time, which is about the max my old brain can handle anyway. The hard part is doing 'working hours' business, but hey, I just email everyone from the potty.
Sorry, ahem, bathroom.