Skip to content

Instantly share code, notes, and snippets.

View Ewerton's full-sized avatar

Ewerton Mattos Ewerton

View GitHub Profile
import { HttpClient, HttpErrorResponse } from '@angular/common/http';
import { Injectable } from '@angular/core';
import { map, Observable, of, switchMap } from 'rxjs';
import { AuthenticatedResult, OidcClientNotification, OidcSecurityService, OpenIdConfiguration, UserDataResult } from 'angular-auth-oidc-client';
import { flatten } from '@angular/compiler';
import { IAuthState } from './IAuthState';
@Injectable({
providedIn: 'root'
})
using IdentityServer.Data;
using IdentityServer.Models;
using Microsoft.AspNetCore.Identity;
using Microsoft.AspNetCore.Identity.UI.Services;
using Microsoft.EntityFrameworkCore;
using PrefeituraBrasil.IdentityServer;
using PrefeituraBrasil.IdentityServer.Service;
using PrefeituraBrasil.Infra.Comunicacoes.Email;
using PrefeituraBrasil.Infra.Comunicacoes.Email.Interfaces;
using Serilog;
@Ewerton
Ewerton / ServiceCollectionExtensions.cs
Created November 19, 2021 18:16 — forked from ReallyLiri/ServiceCollectionExtensions.cs
ASP.NET dependency injection extensions
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using Microsoft.AspNetCore.Routing;
using Microsoft.Extensions.DependencyInjection;
namespace ServiceCollectionExtensions
{
public static class ServiceCollectionExtensions
@Ewerton
Ewerton / GetServerNameFromDSN.vb
Created September 8, 2020 13:03
Gets the server name from a DSN registered in the computer
'Gets the server name from a DSN registered in the computer
Public Shared Function GetServerNameFromDSN(ByVal nomeDSN As String) As String
Dim retorno As String = String.Empty
Try
Using key As RegistryKey = Registry.CurrentUser.OpenSubKey("SOFTWARE\ODBC\ODBC.INI\" & nomeDSN)
If key IsNot Nothing Then
Dim o As Object = key.GetValue("Server")
@Ewerton
Ewerton / settings.json
Created September 8, 2020 12:57
Windows Terminal Profile Settings
// This file was initially generated by Windows Terminal 1.1.2233.0
// It should still be usable in newer versions, but newer versions might have additional
// settings, help text, or changes that you will not see unless you clear this file
// and let us generate a new one for you.
// To view the default settings, hold "alt" while clicking on the "Settings" button.
// For documentation on these settings, see: https://aka.ms/terminal-documentation
{
"$schema": "https://aka.ms/terminal-profiles-schema",