Skip to content

Instantly share code, notes, and snippets.

@minajevs
minajevs / Example.cs
Created December 5, 2019 07:42
An example how to test a middleware or message handler, which uses `HttpContext.GetTokenAsync("access_token")`
//
// `GetTokenAsync` usage
//
protected override async Task<HttpResponseMessage> SendAsync(
HttpRequestMessage request,
CancellationToken cancellationToken)
{
request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", _httpContextAccessor.HttpContext.GetTokenAsync("access_token").Result);
@JoaquimLey
JoaquimLey / github_multiple-accounts.md
Last active April 30, 2023 22:17
How to Work with GitHub and Multiple Accounts

Step 1 - Create a New SSH Key

We need to generate a unique SSH key for our second GitHub account.

ssh-keygen -t rsa -C "your-email-address"

Be careful that you don't over-write your existing key for your personal account. Instead, when prompted, save the file as id_rsa_COMPANY. In my case, I've saved the file to ~/.ssh/id_rsa_work.

Step 2 - Attach the New Key