This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace SimpleHttp | |
{ | |
using System; | |
using System.Buffers; | |
using System.Collections.Generic; | |
using System.Diagnostics.CodeAnalysis; | |
using System.IO; | |
using System.Net; | |
using System.Net.Security; | |
using System.Net.Sockets; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace StdOutAccessToken | |
{ | |
public static class Program | |
{ | |
/// <summary> | |
/// Run this code on your Azure VM with your production managed identity assigned to it. | |
/// </summary> | |
public static async Task Main() | |
{ | |
const string managedIdentityProdClientId = "d094c1df-8827-400d-b835-08a1aaa62a91"; // CHANGE TO YOUR MANAGED IDENTITY CLIENT ID IN YOUR PRODUCTION SUB |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace UpdateDefaultBranch | |
{ | |
using System; | |
using System.Net.Http; | |
using System.Net.Http.Headers; | |
using System.Text; | |
using System.Text.Json; | |
using System.Threading.Tasks; | |
using Azure.Core; | |
using Azure.Identity; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// <PackageReference Include="SymCryptNative" Version="103.4.2" /> | |
// <PackageReference Include="BenchmarkDotNet" Version="0.13.12" /> | |
namespace VerifyRS256JWTSignature | |
{ | |
using BenchmarkDotNet.Attributes; | |
using BenchmarkDotNet.Running; | |
using Microsoft.IdentityModel.Tokens; | |
using System; | |
using System.IdentityModel.Tokens.Jwt; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Example appsettings.json | |
{ | |
"AzureManagedIdentityClientId": "YOURGUID", | |
"AzureKeyVaultAADScope": "https://vault.azure.net", | |
"AzureKeyVaultUrl": "https://YOURAKV.vault.azure.net/", | |
"AzureKeyVaultCertificateSecret": "akv_secret_for_cert", | |
"AzureKeyVaultCloudeflareApiKeySecret": "akv_secret_forcloudflareapikey", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace CertificateUpdater | |
{ | |
using System; | |
using System.Diagnostics; | |
using System.IO; | |
using System.Text.Json; | |
using System.Threading; | |
using System.Threading.Tasks; | |
using Azure; | |
using Azure.Core; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
<Project Sdk="Microsoft.NET.Sdk"> | |
<PropertyGroup> | |
<OutputType>Exe</OutputType> | |
<TargetFramework>net6.0</TargetFramework> | |
</PropertyGroup> | |
<ItemGroup> | |
<PackageReference Include="Azure.Identity" Version="1.10.3" /> | |
</ItemGroup> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <Windows.h> | |
#include <DbgEng.h> | |
#include <DbgHelp.h> | |
#include <cstdio> | |
#include <string> | |
#include <vector> | |
template <typename T, ULONG N> constexpr ULONG countOf(T const (&)[N]) noexcept { return N; } | |
#define addr(x) &x[0] | |
#define IfFailCleanup(EXPR) do { hr = (EXPR); if(FAILED(hr)) { goto cleanup; } } while (0) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace PerfectHash | |
{ | |
using System; | |
using System.Collections.Generic; | |
using System.Runtime.CompilerServices; | |
using System.Runtime.InteropServices; | |
using static System.Numerics.BitOperations; | |
public static class PerfectHash | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace ParallelXxHash32 | |
{ | |
using System; | |
using System.Diagnostics; | |
using System.Runtime.CompilerServices; | |
using System.Runtime.Intrinsics; | |
using System.Runtime.Intrinsics.X86; | |
using BenchmarkDotNet.Attributes; | |
using BenchmarkDotNet.Running; | |
using static Extensions; |
NewerOlder