For the record, in 2005 I told him about Million Dollar Homepage, and he was angry that someone could get rich off such a stupid idea when so many others fail.
Use diagrams to have a visual/spatial map of the work and workpieces. PlantUML makes this quick/easy to do. Freeplane/Freemind is also helpful.
It is then easy to place yourself quickly as working somewhere in a spatial map.
Work in planned chunks. "Serialize" and "deserialize" your mental state by having a captain's log. Use a markdown text file to note:
What you are planning to do ( at the beginning of a session) - be concrete and specific.
At the end of a session record what you did and need to do when you start next. Next session start by reading the previous entry. Occasionally review a few entries for trends.
This is like a dev journal that includes dates times duration and comments about observations that can be used to tune your workflow. I.e. observations of what we're distractions, unexpected problems and timesinks, what worked unexpectedly well, etc.
You can then also plan in general when offline and get into the specifics when starting.
Use music to flow faster and to control the character of the flow mindset.
Movie/game soundtracks are often cool as the music is designed to induce mood without distraction of focus.
It also makes coding feel EPIC!
For me a short +-5 minutes of something epic like an Assassin's Creed theme helps me to enter a flow state and build up a mental map of what I'm working on and what tasks I should execute against. Something relatively relaxing and calm. Followed by something like fast paced dubstep to actually drive the work.
When needing to unpack a problem that needs wider focus again something slower. When needing a directed drive something inspiring and paced.