View AesKeyGenerator.cs
public static class AesKeyGenerator
public static string GenerateKey(int bitStrength)
// note: valid bit strength for aes: 128, 192, or 256 bits (16, 24, or 32 bytes)
var random = new System.Security.Cryptography.RNGCryptoServiceProvider();
var keyArray = new byte[bitStrength / 4];
var base64key = Convert.ToBase64String(keyArray);
View AuthenticationMiddleware.cs
public class MyAuthenticationMiddleware : AuthenticationMiddleware<MyAuthenticationOptions>
public MyAuthenticationMiddleware(
IMyService myService, // inject service here?? (via Startup.ConfigureServices(), services.AddTransient() )
RequestDelegate next,
IOptions<MyAuthenticationOptions> options,
ILoggerFactory loggerFactory,
UrlEncoder encoder)
: base(next, options, loggerFactory, encoder)
View pre-commit
# prevent commit to local master branch
branch=`git symbolic-ref HEAD`
if [ "$branch" = "refs/heads/master" ]; then
echo "pre-commit hook: Can not commit to the local master branch."
exit 1
exit 0
View git-bc.cmd
git config --global diff.tool bc
git config --global difftool.bc.path "C:\Program Files\Beyond Compare 4\BComp.exe"
git config --global merge.tool bc
git config --global mergetool.bc.path "C:\Program Files\Beyond Compare 4\BComp.exe"
git config --global alias.mydiff "difftool --dir-diff --tool=bc --no-prompt"
View iphone-text-message-sqlite.sql
-- more info
,coalesce(m.cache_roomnames, ThreadId
,m.is_from_me IsFromMe
,case when m.is_from_me = 1 then m.account
else end as FromPhoneNumber
,case when m.is_from_me = 0 then m.account
else coalesce(, end as ToPhoneNumber
,m.service Service

Keybase proof

I hereby claim:

  • I am aaronhoffman on github.
  • I am aaronhoffman ( on keybase.
  • I have a public key whose fingerprint is CA49 A892 C3FF 3F8B 95B4 8309 B693 4228 86D5 7E4F

To claim this, I am signing this object:

View KuduWebJobService.cs
public class KuduWebJobService
private string KuduUserName { get; set; }
private string KuduPassword { get; set; }
private string AzureWebsiteName { get; set; }
public KuduWebJobService()
this.KuduUserName = "";
this.KuduPassword = "";
View email-to-sms.csv
provider emailDomain
US Cellular
View ky-county-district-map.csv
CountyName District
Adair KY1
Allen KY1
Anderson KY6
Ballard KY1
Barren KY2
Bath KY4
Bell KY5
Boone KY4
Bourbon KY6
View search-db-for-guid.sql
-- SQL Query to search every guid/uniqueidentifier column in a database for the given id
declare @Id uniqueidentifier = 'ED4D0741-B092-4F0A-9E10-51C19265357C'
-- set to 1 to only search within columns that have '%id%' in the name, for all columns of uniqueidentifier type, set to 0
declare @onlyColumnsWithIdInName bit = 1
declare @Columns table (TableName varchar(200), ColumnName varchar(200))
insert into @Columns (TableName, ColumnName)