Skip to content

Instantly share code, notes, and snippets.


Jeff Wilcox jeffwilcox

View GitHub Profile
jeffwilcox / checkGraph.ts
Created Jun 4, 2021
Quick script to identify users that no longer resolved in the directory
View checkGraph.ts
// Copyright (c) Microsoft.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
import throat from 'throat';
import app from '../../../app';
import { IProviders } from '../../../interfaces';
import { ErrorHelper } from '../../../transitional';
jeffwilcox / generate-key-and-token.js
Created Jul 11, 2019
Generating a token in Node.js
View generate-key-and-token.js
// simple JavaScript (Node.js CLI) generating of a key and token
const crypto = require('crypto');
const myKey = crypto.randomBytes(32).toString('base64');
console.log('This is your key. Store is very securely, i.e. KeyVault:');
const sha1 = crypto.createHash('sha1');
jeffwilcox / gist:2431936
Created Apr 20, 2012
Is a PropertyInfo a static property?
View gist:2431936
public static bool IsStatic(this PropertyInfo propertyInfo)
return ((propertyInfo.CanRead && propertyInfo.GetMethod.IsStatic) ||
(propertyInfo.CanWrite && propertyInfo.SetMethod.IsStatic));
// So a replacement for getting private and public non-static properties in a type...
public static bool IsStatic(this PropertyInfo propertyInfo)
return ((propertyInfo.CanRead && propertyInfo.GetMethod.IsStatic) ||
View sample-digest-data.json
"submitter": "jwilcox",
"reviewers": ["tim", "nikhil"],
"data": {
"componentName": "react",
"componentVersion": "15.6.1"
jeffwilcox / deploy.cmd
Created Feb 24, 2017
Mail2Bug deployment script for a triggered WebJob deployment
View deploy.cmd
@if "%SCM_TRACE_LEVEL%" NEQ "4" @echo off
:: ----------------------
:: KUDU Deployment Script
:: Version: 1.0.7
:: ----------------------
:: Prerequisites
:: -------------

Keybase proof

I hereby claim:

  • I am jeffwilcox on github.
  • I am jeffwilcox ( on keybase.
  • I have a public key ASBuEKl7kirZR3CekzozA9tkXJY4hr4oL_qrANuKEU5iMAo

To claim this, I am signing this object:

jeffwilcox /
Last active Dec 18, 2015
Bash script for bringing online a node in a MongoDB cluster powered by Windows Azure IaaS VMs
# Copyright (c) Microsoft. All rights reserved.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# Unless required by applicable law or agreed to in writing, software
jeffwilcox / updown.js
Created Jun 21, 2013
Simple wrapper over the azure npm module for uploading and downloading blobs
View updown.js
// Simple wrapper over APIs for uploading and downloading blobs from Windows Azure Storage
// by Jeff Wilcox. Apache 2 license, have fun with it.
var azure = require('azure')
, fs = require('fs');
if (process.argv.length < 3) {
console.log('Please call with the proper arguments.');
console.log('node updown.js ACCOUNT KEY CONTAINER up FILENAME');
console.log('node updown.js ACCOUNT KEY CONTAINER down FILENAME');
jeffwilcox / gist:2431507
Created Apr 20, 2012
Reflection comparison
View gist:2431507
// Windows Phone / Standard .NET:
// var mi = dataLoaderType.GetMethod(methodName, paramTypes);
// Windows 8 XAML Metro style app:
var mi = dataLoaderType.GetTypeInfo().GetDeclaredMethods(methodName);
MethodInfo actualMethod = null;
foreach (var method in mi)
// Eeeew code.
var parameters = method.GetParameters();
jeffwilcox / gist:2432351
Created Apr 20, 2012
WinRT IsInstanceOfType, IsAssignableFrom
View gist:2432351
/// <summary>
/// Determines whether the specified object is an instance of the current Type.
/// </summary>
/// <param name="type">The type.</param>
/// <param name="o">The object to compare with the current type.</param>
/// <returns>true if the current Type is in the inheritance hierarchy of the
/// object represented by o, or if the current Type is an interface that o
/// supports. false if neither of these conditions is the case, or if o is
/// null, or if the current Type is an open generic type (that is,