I recently came across something like that for opensource Java code, called `grepcode`:
http://grepcode.com/file/repository.grepcode.com/java/root/j...
It supports quite a big number of Java code repositories it seems.
Edit: Also sourcegraph (linked in a link in a sibling post) does something similar:
https://sourcegraph.com/github.com/gorilla/websocket/-/blob/...
Edit: On a little further reflection, it would be really fun to build. I can imagine a site called something like readgithub.org, which is a dedicated site for reading the code hosted in github repositories. You could start focusing on projects in one language only.