http://www.leginfo.ca.gov/cgi-bin/displaycode?section=lab&gr...
The gist: Has to be your own time, own resources, and not related to your company's current or anticipated business.
It's that last clause that's the kicker. For some companies, it's easy to prove -- e.g. wood working is probably unrelated to Twitter's businesses. For other companies that literally work on everything (eg. Google/Alphabet)... it's a pain in the ass. Also: Many companies make reporting the IP or side work a stipulation of your employment contract -- ostensibly, so they can claim that it is related to their business in some way. It's right there in Code 2871. :)
PS: IANAL.