Over the last year I found myself coding in the strangest of places; I was travelling without a PC and relying on net cafes whenever I could find them.
So one time, similar to yours, I had an ahah experience about an abstraction layer for a spidering application -- I fleshed it out in my travel log while spending several days in a dirt floor home in a tribal village in Flores, Indonesia.
Another time I had to patch and release one of my modules while waiting out a rainstorm on the coast of Vietnam from an excruciatingly slow net drop in a local net cafe. I already had to wait to find this cafe, because most of the cafes in Vietnam filter out the ssh protocol, but for some reason this one allowed it.
Hmm, this would make a good root node -- where's the strangest place you've ever coded?