I mix Adderall and marijuana. It's horrible for my health, but boy does it work. Adderall gets my mind moving, and pot keeps me sitting in my chair, ignorant of the passage of time, focused on work.
As counterproductive as it seems, I think pot makes me more mindful, which can boost my work productivity. Sometimes I will smoke and then spend 30 minutes organizing my folder structures, documenting code, or writing a script to do something that I do manually everyday. When I'm not on pot, all of those tasks seem too trivial to justify doing.