For the better part of the previous decade, San Francisco was a frequent punching bag in certain corners of popular media.