Also, most of the code isn't really that cool on its own. It's not like you can just copy paste FB's code and have Facebook.
You need all of the data that the algorithms use, infrastructure, and much more.
If you searched hard, you probably could find snippets of FB code on Stackoverflow when employees ask questions.
But after the first few weeks on the job, any engineer would realize they should anonymize the
I think I might have pasted 1 or 2 raw snippets of PHP on the first few days I was learning code at FB, and actually got some people to reply on StackOverflow saying "what the hell kind of PHP is that"... turns out I was pasting snippets of "Hack", our at the time very secret language.
Honestly people have overblown ideas about the value of source code, and how useful stolen source code is.
If you had Google's source code it wouldn't guarantee you to make your own Google search engine. You also need the servers, network infrastructure, and engineers.
Google has source code that isn't available to the typical engineer (that would be the code France wants Google to publish, actually). For a long time the average Google Engineer didn't even have access to the Android dev tree even though we routinely re-publish the tree to the Open Source community.
Most of the code wouldn't work outside of Google's infrastructure anyway. Imagine a program that's amazing but it crashes twice per day. Pretty useless at a normal shop, but Google can deploy 12 copies of it across 3 continents at 6 different locations and automatically route traffic away from the crashes.