Skip to content

Instantly share code, notes, and snippets.

View jeffwilcox's full-sized avatar

Jeff Wilcox jeffwilcox

View GitHub Profile
@jeffwilcox
jeffwilcox / apache2-copyright-header.js
Last active June 12, 2023 19:56
Sample Microsoft headers for use in open source projects
February 2013 Home Workstation
---
Intel Core i7-3770K Ivy Bridge 3.5GHz (3.9GHz Turbo) LGA 1155 77W Quad-Core Desktop Processor Intel HD Graphics 4000 BX80637I73770K
CORSAIR Vengeance 32GB (4 x 8GB) 240-Pin DDR3 SDRAM DDR3 1600 Desktop Memory Model CMZ32GX3M4X1600C10
2x Intel 520 Series Cherryville SSDSC2CW180A310 2.5" 180GB SATA III MLC Internal Solid State Drive (SSD) - OEM
2x Intel 520 Series Cherryville SSDSC2CW120A310 2.5" 120GB SATA III MLC Internal Solid State Drive (SSD) - OEM
GIGABYTE GA-Z77X-UP5 TH LGA 1155 Intel Z77 HDMI SATA 6Gb/s USB 3.0 ATX Intel Motherboard with Dual Thunderbolt
ZALMAN CNPS9900MAX-B 135mm Long life bearing CPU Cooler Blue LED
Antec EarthWatts Green EA-380D Green 380W Continuous power ATX12V v2.3 / EPS12V 80 PLUS BRONZE Certified Active PFC Power ...
Antec Three Hundred Two Case
@jeffwilcox
jeffwilcox / checkGraph.ts
Created June 4, 2021 14:30
Quick script to identify users that no longer resolved in the directory
//
// 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
jeffwilcox / generate-key-and-token.js
Created July 11, 2019 19:16
Generating a token in Node.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:');
console.log(myKey);
console.log();
const sha1 = crypto.createHash('sha1');
sha1.update(myKey);
@jeffwilcox
jeffwilcox / gist:2431936
Created April 20, 2012 21:11
Is a PropertyInfo a static property?
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) ||
@jeffwilcox
jeffwilcox / sample-digest-data.json
Last active July 11, 2017 17:06
Sample digest data
[
{
"submitter": "jwilcox",
"reviewers": ["tim", "nikhil"],
"data": {
"componentName": "react",
"componentVersion": "15.6.1"
}
},
{
@jeffwilcox
jeffwilcox / deploy.cmd
Created February 24, 2017 17:20
Mail2Bug deployment script for a triggered WebJob deployment
@if "%SCM_TRACE_LEVEL%" NEQ "4" @echo off
:: ----------------------
:: KUDU Deployment Script
:: Version: 1.0.7
:: ----------------------
:: Prerequisites
:: -------------
@jeffwilcox
jeffwilcox / keybase.md
Created September 6, 2016 05:49
keybase.md

Keybase proof

I hereby claim:

  • I am jeffwilcox on github.
  • I am jeffwilcox (https://keybase.io/jeffwilcox) on keybase.
  • I have a public key ASBuEKl7kirZR3CekzozA9tkXJY4hr4oL_qrANuKEU5iMAo

To claim this, I am signing this object:

@jeffwilcox
jeffwilcox / setupMongoNode.sh
Last active December 18, 2015 22:39
Bash script for bringing online a node in a MongoDB cluster powered by Windows Azure IaaS VMs
#!/bin/bash
#
# 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
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
@jeffwilcox
jeffwilcox / updown.js
Created June 21, 2013 20:07
Simple wrapper over the azure npm module for uploading and downloading blobs
// 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');