Have 6-12 months in an emergency fund and be prepared to move out of SF if you'll burn through all of that fund.
Don't sign a new lease or buy a house or a new car.
Diversify. Put money in things that are uncorrelated with tech money. Keep your CV up to date and work on transferrable skills - e.g. see if you can get your job title changed to one that implies some level of management responsibility.
be good at programming?
Hahah.
Being good at programming is useful, but planning what happens if random changes in the business screw you is still useful.
I've been a software engineer for going on 20 years now. Have a plan, just in case, even if you're good at programming (I am.)