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
#!/bin/bash | |
# generate file containing all URIs to execute to retrieve data from hacker news firebase API | |
# api docs: https://github.com/HackerNews/API | |
echo generating file hn-uri.txt | |
URICOUNT=10000000 | |
echo file will contain $URICOUNT lines |
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 ActionResult StartOAuth() | |
{ | |
var redditOAuthAuthorizeUri = "https://www.reddit.com/api/v1/authorize"; | |
var redditOAuthRedirectUri = "https://localhost:44399/RedditRedirectUri"; // your redirect uri | |
var redditOAuthScopes = ""; // ex: "identity,history" scope param https://github.com/reddit/reddit/wiki/OAuth2#authorization | |
var redditClientId = ""; // from app: https://www.reddit.com/prefs/apps | |
var oauthState = Guid.NewGuid(); // used to uniquely identify this request | |
// todo: store oauthState somewhere... | |
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
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
public class KuduWebJobService | |
{ | |
private string KuduUserName { get; set; } | |
private string KuduPassword { get; set; } | |
private string AzureWebsiteName { get; set; } | |
public KuduWebJobService() | |
{ | |
this.KuduUserName = ""; | |
this.KuduPassword = ""; |
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
-----BEGIN PGP SIGNED MESSAGE----- | |
Hash: SHA512 | |
keybase is fun! | |
-----BEGIN PGP SIGNATURE----- | |
Version: Keybase OpenPGP v2.0.76 | |
Comment: https://keybase.io/crypto | |
wsBcBAABCgAGBQJaJtRyAAoJEGnJ5Wt+lYeyjTIH/13v97tzANkiSM3i+Vbr9Q8g | |
isis5gh3+4slL2SgsiF0YvnUH5o2hycYArm6r05DLdPZ2rja1YEzB1K0IV2EoAad |
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 |