I’m not sure if it makes sense to try to find a “scientifically proven” technique if all you want is something that works for you . What works for a large group of people in a controlled scientific study does not necessarily work for each individual in that study, let alone for you. You could do a scientific study on yourself, though. Figure out some objective way to measure your own concentration, and then try vario…
Ritalin is that pill. I know a bunch of devs that take it to code through the whole night.
But...!
1. It usually requires a prescription.
2. While it lets you hyper-focus on one task for hours, if you not careful that task could be rearranging your cutlery.