In California it is illegal. If you work in trendy software companies, startups, etc - it probably isn't common because so many people have Githubs.
As a embedded software engineer, I've had specific language claiming rights to everything (one even called out "songs or other copyrightable works") I do while employed at the company at 4/4 of my post-college jobs.