For my link archive, the table of contents of [Wayback/Archive/Archive] Searching code – GitHub Docs:
Limitations apply:
Due to the complexity of searching code, there are some restrictions on how searches are performed:
- You must be signed into a user account on GitHub to search for code across all public repositories.
- Code in forks is only searchable if the fork has more stars than the parent repository. Forks with fewer stars than the parent repository are not indexed for code search. To include forks with more stars than their parent in the search results, you will need to add
fork:true
orfork:only
to your query. For more information, see “Searching in forks.”- Only the default branch is indexed for code search.
- Only files smaller than 384 KB are searchable.
- Only repositories with fewer than 500,000 files are searchable.
- Only repositories that have had activity or have been returned in search results in the last year are searchable.
- Except with
filename
searches, you must always include at least one search term when searching source code. For example, searching forlanguage:javascript
is not valid, whileamazing language:javascript
is.- At most, search results can show two fragments from the same file, but there may be more results within the file.
- You can’t use the following wildcard characters as part of your search query:
. , : ; / \ ` ' " = * ! ? # $ & + ^ | ~ < > ( ) { } [ ] @
. The search will simply ignore these symbols.
There is a truckload of languages supported, though the yaml format of the list is not really human readable: [Wayback/Archive] linguist/languages.yml at master · github/linguist
I’ll try this and see if it works better than Google Search.
Via:
- [Archive] 🔎Julia Evans🔍 on Twitter: “this is a cool idea and I should remember to do it more”
- [Archive] Reilly Wood on Twitter: “@b0rk Finding obscure code examples is super easy now! GitHub search can quickly find working code using virtually any API/package/protocol – I use it for that multiple times/week”
- [Archive] Reilly Wood on Twitter: “@jfarmer @b0rk Usually start with known identifiers (function names, package names, whatever) and then use filename/extension/language filters to whittle down the results”
–jeroen