Yours is one of the few responses about SF that knows what they're talking about. Too many posters here at FR knock SF (and California) as being beyond hope and infested with gays. Nothing could be farther from the truth. SF is beginning to return to normalcy. For 2/3rds of the 20th century it was a conservative place, as was most of California. Hippie liberals started arriving from elsewhere in the mid-1960s and began to ruin things; then gays migrated in. They've been leaving over the last couple decades. They're a minority, and their numbers are declining.
As you stated, the hill of SF used to be covered with rich people's homes. Now they're returning, in the guise of techies and professionals. And as you say, the same wealth that built Stanford University also built SF long ago. I'm in the midst of remodeling my mother-in-law's home in SF. Prices are going up 10 percent each year, as rich people move in and gentrify the neighborhood. A home half a block up was remodeled and sold over $2 million. It's crazy. Everywhere in SF there is gentrification and "ghettos" no longer really exist. The tech boom of Silicon Valley has moved north into SF, and the bums are being edged out. Too bad, but the city is better off without the freeloaders.
Well, the improvements have improved the average quality of schools and made for safer neighborhoods, but the bums are still around in force, all over downtown. They are kept around rather like civic pets.
Politics is certainly considerably different. One gets the impression that Ed Lee and co. are being politely patronizing to the geriatric liberals.