Sharing how I deal with similar situations:
I go out and try to stay out as much as possible. Working in a coffee shop gives the illusion that you are not alone. I also cook elaborate dinner involving pasta, sit down with a glass of wine and watch a movie as a picker-upper. But of late I've been using this trick a lot and it has fast hit diminishing returns. Perhaps I should use exercise as a pick-me-up.
The problem with being down is, you will be even less inclined to do the things that are most likely to help you get better.
Sometimes I reread Jerome K. Jerome. Brings back childhood to some extent and some giggles. Douglas Adams too. Or I re-purpose librivox.org as my bed time story teller. Mostly I hang out here [HN]. Then I refresh my log... people using your app can cheer you up. Learning something new helps too.