This is an interesting one. I've always listened to music throughout the majority of the day. However I've noticed recently that for certain programming tasks (anything that requires serious thought or I haven't done before) I work much better with silence. However when doing stuff I've done before (CRUD apps, writing boilerplate code necessary before the fun stuff) I am more productive with up beat music.
I find it also depends a lot on the genre. Music without lyrics, whether that be trance, classical, or jazz can be great for focusing because it drops into the background but the beat drives you forward almost subconsciously.
Drinking less increases my productivity. I don't drink that much, max of a couple drinks a night, a few nights a week. Not binge, not so much that I'd be drunk.
There was a period over the summer where I cut it back to about 1 drink per night on friday/saturday. Looking at my github activity, it's _obvious_ when that was.