Sometimes life is hard, personal stuff clouds the mind and makes it hard to do some creative coding. At those times I resort to Zombie coding.
Zombie coding: It means to do the work that needs to be done without thinking. Without creativity or innovation, you just go through with it. It helps to get through the day, get the job done and do a good job.
A nice thing though is that when having some bad times, going to work and doing the job makes it a lot easier to handle the hard times, since the daily routines keeps the mind from going into chaotic thinking patterns.