Search notes:

GitHub

Using github's Rest API

Github's Rest API is accessed on https;//api.github.com/
The answers are returned in JSON.
Some requests:
curl.exe https://api.github.com/
curl.exe https://api.github.com/users/ReneNyffenegger
curl.exe https://api.github.com/users/ReneNyffenegger/repos
curl.exe https://api.github.com/repos/ReneNyffenegger/about-PowerShell

curl.exe -u ReneNyffenegger:MySecret https://api.github.com/xxxx
See also here.

X-RateLimit-Limit / X-RateLimit-Remaining

The two response headers X-RateLimit-Limit and X-RateLimit-Remainig inform how many requests an unauthenticated client can make in a time frame (of one hour?) and how many requests can still be made in this time frame.

Using Personal Access Tokens

A personal access token authenticates a client when doing an API request.
The two important features of access tokens are:
  • Revokable access
  • Controlling scope of access
Thus, with an access token, it's possible, for example, to inquire about private repositores (if the token is granted accessing private repositories.)
Such a personal access token must be generated, for example, when logged in github, in https://github.com/settings/tokens/
When authenticated with an access token, the request limit raises to 5000/hour.
With curl the request is made like so:
$accessToken=01234567890abcdef01234567890abcdef012345
curl -u x:$accessToken https://api.github.com/repos/ReneNyffenegger/about-PowerShell
With PowerShell, its possible to use an access token like so
$secString=convertTo-secureString $accessToken -asPlainText -force
invoke-webrequest https://api.github.com/repos/ReneNyffenegger/private-repo -authentication bearer -token $secString
2020-03-10: Apparently, the -authentication option of invoke-webRequest is only avaible with PowerShell 6 and later. In earlier versions, the -header option can be used;
$accessToken=01234567890abcdef01234567890abcdef012345
invoke-webrequest https://api.github.com/repos/ReneNyffenegger/private-repo -headers @{Authorization = "Bearer $accessToken"}
While access tokens can be configured to allow or deny certain actions, these actions are allowed on all repository, it's not possible to limit them to specific repositories.

Searching

Searching for a string in my projects on github

With Google's site: and inurl: search options, it's possible to find specific source code in someone's repositories on github: onresize site:github.com inurl:ReneNyffenegger

Advanced search

Code search

cs.github.com promises to search for code with regular expressions.

Browsing a github repository like in VS Code

A github repository can be browsed as though it was in Visual Studio Code by replacing the github.com part of the URL with github1s.com, for example https://github1s.com/ReneNyffenegger/cpp-base64/.
It's also possible to reach this editor with the shortcut key . (the period key).

Discussions

Github discussions allows to add a forum to a repository.
The purpose of such a forum is to have a means to discuss things that don't necessarily need to go into Github Issues.
Discussions must be enabled in Settings (the gear symbol) under Features.

Detecting languages in a repository

Github uses the liguist library to determine the languages in a repository.
A list of recognized languaes is in the repository's file lib/linguist/languages.yml
The result of the linguist algorithm can be overwritten with a .gitattributes files.

Github web pages

Having a Github account allows to create a website for the account
More information at pages.github.com.

TODO

Topics help to classify repositories with tags (such as dataquality) in order to help find these repos.
These topics can be changed by clicking on the gear symbol to the right of «About».
https://github.com/settings/tokens: Tokens generated to access the GitHub API
https://github.com/settings/security: An account's security events
https://github.com/contact: getting help

See also

github markdown
Github gists
Adding my tq84 branch to github repositories
Microsoft GitHub Actions
The Oracle package dbms_cloud_repo.

Links

Preparing and submitting a pull request.
My git awards
github.com/trending: Trending github repositories. Can also be queried with a tag: github.com/trending/vim.
github.com/explore

Index