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
# more info https://aaron-hoffman.blogspot.com/2020/12/Find-Azure-Application-Insights-Resource-by-InstrumentationKey.html | |
# for each subscription in context | |
foreach ($subId in (Get-AzSubscription).Id | Get-Unique) { | |
write-host "Subscription $subId" | |
# set context to the given subId | |
Set-AzContext -SubscriptionId $subId | |
# List the name and InstrumentationKey of all Application Insights resources in this sub | |
Get-AzResource -ResourceType Microsoft.Insights/components -ExpandProperties | select -ExpandProperty Properties | select Name, InstrumentationKey | ft |
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
;========================================= | |
; AutoHotKey scripts for Corrections/Improvements to Mac keyboard on Windows OS https://github.com/aaronhoffman/autohotkey | |
;========================================= | |
; NOTES | |
; ! = ALT | |
; ^ = CTRL | |
; + = SHIFT | |
; # = WIN | |
#InstallKeybdHook |
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
using System; | |
using System.Collections.Concurrent; | |
using System.Threading; | |
using System.Threading.Tasks; | |
public class ThreadSafeConcurrentDictionary | |
{ | |
public bool TryGetValue<TValue>(string key, out TValue value) | |
{ | |
return _dictionary.TryGetValue(key, out value); |
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
public static class AsyncHelper | |
{ | |
private static readonly TaskFactory _taskFactory = new | |
TaskFactory(CancellationToken.None, | |
TaskCreationOptions.None, | |
TaskContinuationOptions.None, | |
TaskScheduler.Default); | |
public static TResult RunSync<TResult>(Func<Task<TResult>> func) | |
{ |
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
public interface IRandomFactory | |
{ | |
Random CreateOrRetrieve(); | |
} | |
public class RandomFactory : IRandomFactory | |
{ | |
public Random CreateOrRetrieve() | |
{ | |
return _threadLocalRandom.Value; |
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
// source: https://mikhail.io/2015/04/unit-testing-null-parameter-checks/ | |
public void ConstructorMustThrowArgumentNullException(Type type) | |
{ | |
foreach (var constructor in type.GetConstructors()) | |
{ | |
var parameters = constructor.GetParameters(); | |
var mocks = parameters.Select( | |
p => | |
{ |
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
// <auto-generated /> | |
using System; | |
using IdentityServer4.EntityFramework.DbContexts; | |
using Microsoft.EntityFrameworkCore; | |
using Microsoft.EntityFrameworkCore.Infrastructure; | |
using Microsoft.EntityFrameworkCore.Metadata; | |
using Microsoft.EntityFrameworkCore.Migrations; | |
using Microsoft.EntityFrameworkCore.Storage.ValueConversion; | |
namespace SqlServer.Data.Migrations.IdentityServer.ConfigurationDb |
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
using System; | |
using System.IO; | |
using System.Security.Cryptography; | |
using System.Text; | |
public class RSACryptoServiceProviderHelper | |
{ | |
// code from here: | |
// - https://stackoverflow.com/questions/23734792/c-sharp-export-private-public-rsa-key-from-rsacryptoserviceprovider-to-pem-strin | |
// - https://stackoverflow.com/questions/28406888/c-sharp-rsa-public-key-output-not-correct/28407693#28407693 |
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
StateName | StateCode | CondensedPostalCodeRanges | |
---|---|---|---|
Alabama | AL | 35000-35299;35400-36999 | |
Alaska | AK | 99500-99999 | |
Arizona | AZ | 85000-85399;85500-85799;85900-86099;86300-86599 | |
Arkansas | AR | 71600-72999 | |
California | CA | 90000-90899;91000-92899;93000-96199 | |
Colorado | CO | 80000-81699 | |
Connecticut | CT | 06000-06389;06391-06999 | |
Delaware | DE | 19700-19999 | |
District of Columbia | DC | 20000-20099;20200-20587;56900-56999;20589-20597;20599 |
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
using System; | |
using Newtonsoft.Json; | |
using Newtonsoft.Json.Linq; | |
public class TrivialJsonConverter : JsonConverter | |
{ | |
public override bool CanConvert(Type objectType) | |
{ | |
return true; | |
} |
NewerOlder