Having a portfolio is important. As I noted in my other comment, code samples have a big impact on hiring decisions. You absolutely must have them, even if they aren't posted publicly.
If you decline every job that has a contract that says all work belongs to the company, you'll have a very hard time finding a job. (outside of states where the law specifically covers this case) The ones that don't have it will be ones where the management doesn't know any better, or (maybe) where you're a cofounder.
For reference I'll point you to Joel's writeup on answers.onstartups.com: http://answers.onstartups.com/questions/19422/if-im-working-...
So no, apparently I -won't- have a problem finding a job.
But that's by far the minority of workers in the US. The only states, to my knowledge, which have specific laws regarding side projects are California, Delaware, Minnesota, Illinois, Kansas, North Carolina, and Washington.
Pretty much every (developer) employment contract I've seen has had a clause similar to this one in it: http://www.elinfonet.com/prov/65 The only option is to refuse to sign it(and get fired/walk out) the day you start working (since they don't give you the standard contract stuff until you start), ask for the contracts up front as part of the interview (probably a good idea) and refuse to accept if it's not changed, or sign it because you need a job.
I suppose you could also move to a state which has protections, but saying you should refuse to sign that kind of contract is rather disingenuous; the majority of people in the US do not have the luxury of simply refusing to sign a contract they find onerous.(either because they need a job, or because almost every company offers the same contract)
The best bet(assuming you live in one of the other 43 states) is to sign it, mention things you've done/are planning on doing, and get written agreements that your employer disclaims ownership over specific side projects started after employment.
Of course, I'm assuming if you have legal/contractual restrictions against open source, those restrictions also apply to making code publicly viewable.