Skip to content

Instantly share code, notes, and snippets.

View doriandres's full-sized avatar

Dorian Andrés doriandres

  • San José, Costa Rica
View GitHub Profile
@doriandres
doriandres / LinkedInOpenIdConnectSample.cs
Last active March 17, 2024 06:56
Sign in users with a C# .NET 8 Application and LinkedIn OpenID Connect
using Microsoft.AspNetCore.Authentication;
using Microsoft.AspNetCore.Authentication.Cookies;
using Microsoft.AspNetCore.Authentication.OpenIdConnect;
using Microsoft.IdentityModel.Protocols.OpenIdConnect;
using System.Security.Claims;
namespace MyApp;
public class Program
{
@doriandres
doriandres / install_node_linux.sh
Last active November 29, 2023 05:07
Commands to install NodeJS in Linux using direct source
# Check OS and Arch (x64 or ARM64)
uname -srm
# Download (Get download url from https://nodejs.org/en/download)
# Will use Node 20 LTS x64 for this example, but it can be replaced by any other version
wget https://nodejs.org/dist/v20.10.0/node-v20.10.0-linux-x64.tar.xz
# Unpack
tar -xf node-v20.10.0-linux-x64.tar.xz
@doriandres
doriandres / unit_test_express_js_routes_handlers_with_jest.md
Last active March 24, 2023 04:26
Unit Test Express JS routes handlers with Jest

Unit Test Express JS routes handlers with Jest

Let's see how we can test Express JS route handlers using Jest

Step 1: Define an API

The following code shows the definition of a very simple yet structured API

/***********************************************************/
/* src/routes/hello.js                                     */