While I haven't had to deal with this sort of thing in about 8 years, rumors of more layoffs at Big Pharma started my thought process moving in this direction. Early this year I realized that I would have this huge gap in my résumé since everything I have worked on in the past few years would be as if it never happened (from a perspective employer's point of view). Since I'm just a lowly contractor and not even an employee, the company I've been placed at is not even permitted to comment that I have been here or not. While I suspect a few managers would choose to ignore this rule for my sake, I can't count on it and prefer not to place the people worked for in that sort of position. Was I here cleaning the floors or writing code? I have no proof that I am permitted to show either way. It sucks, but I knew this might be a problem when I started.
To get around this problem, I started building up a library of non-work related code that I've done at home on my own time as a sort of portfolio I could show to other potential employers (should the need arise). The only problem with this approach is that it takes time to develop anything worthwhile, so my collection of scripts is very small right now and doesn't really reflect what I'm capable of. I only wish I though of doing something like this a few years ago.