Fixing github auth problem, cloning repository to Webstorm IDE

This probably works for other IDEs as well such as VS Code.
My context is Windows 10 and Webstorm version 2024.3.2.1

Problem: was connected to  my “work” github account and wanted also to be able to work with repos in my “private” github account.

Added the Github account in webstorm settings -> version control -> github -> (was logged in on github private account in web browser), got web browser authenticate question -> ok

Cloned a repo, got similar to the following git error message:

remote: Repository not found. fatal: repository 'https://github.com/MyUser/MyRepo.git/' not found

The repository exists at that location, its an auth problem.

Solution:

Tried to setup SSH but was a bit difficult, the “GitHub Desktop” application had no problem cloning and pushing though, but wanted it to work within Webstorm.

I tried the Github CLI application, download here: https://cli.github.com/

Open a terminal within Webstorm/at the project root and execute the gh command:

gh auth login

Follow the instructions regarding auth with web browser, (enter the one-time code at https://github.com/login/device).
Output from my terminal:

$ gh auth login
? Where do you use GitHub? GitHub.com
? What is your preferred protocol for Git operations on this host? HTTPS
? Authenticate Git with your GitHub credentials? Yes
? How would you like to authenticate GitHub CLI? Login with a web browser

! First copy your one-time code: ABCD-1234
Press Enter to open https://github.com/login/device in your browser...
✓ Authentication complete.
- gh config set -h github.com git_protocol https
✓ Configured git protocol
✓ Logged in as AndreasPlahn

Voila! Now it works for me, at least.

Update:
When pushing from Webstorm I get a dialog (on every push) which github acccount I want to be acting as.

This was annoying. Solved in this way:
(in cmd):

git credential-manager github list
-> see all logged in accounts

git credential-manager github logout <MyGithubAccountName>
-> logout one of the accounts to avoid

More info about git credential-manager in Windows:
https://github.com/git-ecosystem/git-credential-manager/blob/release/docs/usage.md

Host and deploy Angular web app using Azure and Github

I am using Angular v17 and node v18.
In simple steps;
Goto azure portal.
Create a new resource of type “Static Web App”
I choose Github as Deployment source.

Regarding Angular v17, I had problems with the github deployment build actions:

  • Node was configured as v16 but angular v17 needs node v18
  • path to index.html for dist build could not be found

After Azure has created the static web app for Github deployment the following file is pushed into the repo:

.github/workflow/azure-static-web-apps-[*].yml

I hade to set the following values correctly:

app_location: "./" # App source code path
output_location: "./dist/gps-tracker/browser" # Built app content directory - optional

The output location should point to where the index.html file is located.
You should change the ‘gps-tracker’ to your application name. To find out exactly run ‘ng build’ locally and look into the created dist folder.

Regarding setting node version to 18: I added the following in the yml file:

env:
  NODE_VERSION: '18.x'

Print screen of node version setting:

C# .NET – Generate error message when “async void” is used in code

The mentioned AsyncFixer extension and Nuget Package are super useful when dealing with async code. They both package a Roslyn analyzer that detects many async issues and provides an automatic fix for them as well in most cases. Using the .editorconfig in Visual Studio you can configure specific warnings as errors:
[*.cs] # AsyncFixer03: Fire-and-forget async-void methods or delegates dotnet_diagnostic.AsyncFixer03.severity = error
And you can set that straight from the Solution Explorer in case you’ve a

Source: c# – Generate error message when “async void” is used in code – Stack Overflow

Use .http files in Visual Studio 2022

The Visual Studio 2022 .http file editor provides a convenient way to test ASP.NET Core projects, especially API apps. The editor provides a UI that:

  • Creates and updates .http files.
  • Sends HTTP requests specified in .http files.
  • Displays the responses.

This article contains documentation for:

The .http file format and editor was inspired by the Visual Studio Code REST Client extension. The Visual Studio 2022 .http editor recognizes .rest as an alternative file extension for the same file format.

Source: Use .http files in Visual Studio 2022 | Microsoft Learn

Meld – Visual diff and merge tool (free/open-source)

Meld  Visual diff and merge tool Meld helps you compare files, directories, and version controlled projects. It provides two- and three-way comparison of both files and directories, and has support for many popular version control systems. Meld helps you review code changes and understand patches. It might even help you to figure out what’s going on in that merge you keep avoiding.

Source: Meld

ClosedXML – .NET library for Excel files

ClosedXML is a .NET library for reading, manipulating and writing Excel 2007+ (.xlsx, .xlsm) files. It aims to provide an intuitive and user-friendly interface to dealing with the underlying OpenXML API.

Source: ClosedXML
License: MIT / Open source project
Doc: https://closedxml.readthedocs.io/en/latest/index.html
Wiki: https://github.com/closedxml/closedxml/wiki

ClosedXML is a wrapper of the offical .NET Open XML SDK:
https://github.com/dotnet/Open-XML-SDK

Top 9 GitHub Copilot alternatives (code completion tools) to try in 2022 (free and paid)

GitHub Copilot is a code completion tool from GitHub and OpenAI. It employs OpenAI’s Codex, a transformer trained on billions of code lines on GitHub, to auto-generate code based on the current file’s contents and your cursor location. Copilot is compatible with popular code editors like Visual Studio Code, Visual Studio, Neovim, and JetBrains IDEs and offers support for languages like Python, JavaScript, TypeScript, Ruby, and Go.

According to GitHub and user reviews, Copilot can generate whole code lines, functions, tests, and documentation. All it needs is context and the behind-the-scenes work of developers who committed their code to GitHub, regardless of their software license.

When the Copilot beta ended, GitHub released the pricing for individual users. The subscription included a 60-day free trial, which would turn to $10/month or $100/year per user.

Source: Top 9 GitHub Copilot alternatives to try in 2022 (free and paid)