Skip to content

Instantly share code, notes, and snippets.

View joperezr's full-sized avatar
🏠
Working from home

Jose Perez Rodriguez joperezr

🏠
Working from home
  • Microsoft
  • Seattle, WA.
  • 09:04 (UTC -07:00)
View GitHub Profile
@joperezr
joperezr / Auth.md
Last active April 1, 2025 21:34
Authentication & Authorization in ASP.NET Core

Deep Dive into ASP.NET Core Authentication, Authorization, and Identity

Authentication vs. Authorization vs. Identity

Authentication is the act of verifying who a user is. When a user successfully authenticates (for example, by entering the correct credentials or token), the application establishes the user’s identity (often represented by a ClaimsPrincipal in ASP.NET Core) (Introduction to authorization in ASP.NET Core | Microsoft Learn). In other words, authentication answers “Who are you?” and results in an identity that the app can use. By contrast, Authorization is about what the authenticated user is allowed to do or access. It answers “What are you allowed to do?” ([Introduction to authorization in ASP.NET Core | Microsoft Learn](https://learn.microsoft.com/en-us/aspnet/core/securit

@joperezr
joperezr / Program.cs
Created March 11, 2025 21:11
Application that helps updating dotnet/aspire repository docker image tag references to latest versions
using Microsoft.Extensions.AI;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using System.ComponentModel;
using System.Data.Common;
using System.Text.Json.Serialization;
var builder = Host.CreateApplicationBuilder(args);
builder.Configuration.AddUserSecrets<Program>();
@joperezr
joperezr / diff.md
Last active October 14, 2024 18:10
.NET Aspire 8.2.1 -> 9.0-rc1 API diff
@joperezr
joperezr / MyTestApi.csproj
Last active September 3, 2024 14:26
How to use Redaction in Logging using the new Microsoft.Extensions.Compliance.Redaction package. For the full Guide, checkout the README.md file on the gist.
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<InvariantGlobalization>true</InvariantGlobalization>
</PropertyGroup>
<ItemGroup>
@joperezr
joperezr / instrucciones.md
Last active November 29, 2023 12:51
Instrucciones para migrar de Google Workspace a O364

Accesar al correo electronico via web y resetear password

El primer paso para realizar la migracion es el autenticarse con microsoft por primera vez, para poder resetear el password de tu cuenta.

Para eso, hay que:

  1. Abrir un navegador de internet, e ir a la pagina https://outlook.com/owa/bustextil.com image
  2. Escrbir tu usuario. Tu usuario es tu correo actual que termina en @bustextil.com, por ejemplo: [email protected]
  3. Dar click en el boton de Siguiente o Next.
BenchmarkDotNet=v0.13.1.1741-nightly, OS=Windows 11 (10.0.22000.593/21H2)
Intel Core i7-8700 CPU 3.20GHz (Coffee Lake), 1 CPU, 12 logical and 6 physical cores
.NET SDK=7.0.100-preview.2.22110.1
  [Host]     : .NET 7.0.0 (7.0.22.10302), X64 RyuJIT
  Job-PXGVYL : .NET 7.0.0 (42.42.42.42424), X64 RyuJIT
  Job-SNEXQP : .NET 7.0.0 (42.42.42.42424), X64 RyuJIT

PowerPlanMode=00000000-0000-0000-0000-000000000000 Arguments=/p:DebugType=portable,-bl:benchmarkdotnet.binlog IterationTime=250.0000 ms 
@joperezr
joperezr / PerfResults.md
Created March 3, 2022 00:14
Perf_Regex_Industry_RustLang_Sherlock result for PR https://github.com/dotnet/runtime/pull/66026
BenchmarkDotNet=v0.13.1.1702-nightly, OS=Windows 11 (10.0.22000.527/21H2)
Intel Core i7-8700 CPU 3.20GHz (Coffee Lake), 1 CPU, 12 logical and 6 physical cores
.NET SDK=7.0.100-preview.2.22110.1
  [Host]     : .NET 7.0.0 (7.0.22.10302), X64 RyuJIT
  Job-IXUFSP : .NET 7.0.0 (42.42.42.42424), X64 RyuJIT
  Job-OTMQBB : .NET 7.0.0 (42.42.42.42424), X64 RyuJIT

PowerPlanMode=00000000-0000-0000-0000-000000000000 Arguments=/p:DebugType=portable,-bl:benchmarkdotnet.binlog IterationTime=250.0000 ms 
@joperezr
joperezr / RegexBackground.md
Last active February 9, 2022 21:06
Small Background about Regex

Brief Background on the inners of Regex

Contrary to the obvious, Regex type itself doesn't know how to match a pattern with a given input. But it does have a factory which aids in producing objects which do know how to do this.

namespace System.Text.RegularExpressions
{
  public class Regex
  {
 protected internal RegexRunnerFactory factory;
@joperezr
joperezr / EventHub.cs
Created November 11, 2019 17:21
Structured Streaming from Azure EventHub using .NET for Apache Spark
using System;
using System.Collections.Generic;
using System.Text.Json;
using System.Text.Json.Serialization;
namespace Sample
{
public class EventHubPosition
{
public string Offset { get; set; }
@joperezr
joperezr / DotNetLinks.md
Created November 1, 2019 20:02 — forked from karelz/DotNetLinks.md
Links about .NET for conferences and customer discussions