GitHub uses its Linguist project to detect languages and index them as far as I know. I've used the list of languages from this file: https://github.com/github/linguist/blob/master/lib/linguist/...
I did pick an older version as they don't always run the latest release. Handy as you can filter out items flagged as "markup". Plus, have to watch out for languages like Mirah that are oddly indexed (same repo count as Ruby).
Looking at Bootstrap, the classification doesn't seem to be strictly based on percentage:
- CSS 59.8% - JavaScript 39.7% - Python 0.5%
...but GitHub Search says JavaScript. I do see that if I do a search query with a language filter, I get different results.