A while ago I found out that gist.github.com/lynatan/673e574faa8343fa01d7a91e75065c54 which I mentioned before in Delphi analog to C# ?? null-coalescing operator and Light Table like debugger evaluation and I wanted to
- find it back
- find the most recent forks of it
The reason was that I was working on the [WaybackSave/Archive] bit Time Professionals on X: “Live now: “Hidden Gems of Delphi Language: Operator Overloading and Class/Record helpers” @jpluimers” session which I presented at [Wayback/Archive] ITDevCon 2024 | Home where I also could enjoy the company of the other [Wayback/Archive] ITDevCon 2024 | Speakers and the famous [Wayback/Archive] IT DevCon 2024 speaker dinner (which attendees can also join for a slight surcharge).
The presentation is at [Wayback/Archive] ITDevCon2024/delphi_language_hidden_gems/delphi_language_hidden_gems.md at main · jpluimers/ITDevCon2024 · GitHub and pictures of the event at [Wayback/Archive] ITDevCon2024 – Google Photos.
Back to the problem at hand
I was hoping a round trip from old github username to github ID to new github username would help, so I did some searching and found [Wayback/Archive] Where can I find the GitHub ID in my account? – Stack Overflow (thanks [Wayback/Archive] harnex, [Wayback/Archive] informatik01, [Wayback/Archive] Raghu Ariga, [Wayback/Archive] Bohemian, [Wayback/Archive] Blessing and [Wayback/Archive] Ogglas) came up with these:
- [Wayback/Archive] Find your GitHub user id
- [Wayback/Archive]
api.github.com/users/github
wheregithub
is the username; usergithub
has"id": 9919
This does not need an API key or authentication, so this works well:
curl -s https://api.github.com/users/<your-user-name> | jq '.id'
- For your own account you can of course do this:
It can be easily retrieved using
Github API
. If you cannot use the API answer or from http://caius.github.io/github_id/ you can go togithub --> settings --> emails
, under the Primary email address you will find{id}+{user_name}@users.noreply.github.com
. The format is simillar to this:50826640+hirwablessing@users.noreply.github.com
, that50826640
is theid
. - The other way around is also simple:
If you do have the GitHub Id but need to find the username / login you can do it like this with the List users endpoint:
Subtract the id by 1 and run the following query. My GitHub Id is
4015237
and therefore the query parameter since receives the value4015236
.https://api.github.com/users?since=4015236&per_page=1
https://docs.github.com/en/rest/users/users?apiVersion=2022-11-28#list-users
Description for since:
Query parameters – since – A user ID. Only return users with an ID greater than this ID.
- [Wayback/Archive] api.github.com/users?since=4015236&per_page=1
- [Wayback/Archive] REST API endpoints for users – GitHub Docs
So for
github
this becomes [Wayback/Archive] api.github.com/users?since=9918&per_page=1 returning[ { "login": "github", "id": 9919, …
Well, it didn’t work out, as [Wayback/Archive] api.github.com/users/lynatan returned
{ "message": "Not Found", "documentation_url": "https://docs.github.com/rest", "status": "404" }
What now?
And back to the gist I was looking for:
--
jeroen