How to setup Git for Windows

I know this document seems long, but it shouldn't be too difficult to follow. This guide is based on Windows, but every program here have Linux/Mac equivalents, and in most cases they're built-in. So, take a deep breath and go step by step.

The steps below are for GitHub, but the steps are almost idential for Bitbucket, Heroku, etc.

You'll probably want to make sure Chocolatey is installed, since it streamlines installing this stuff later. If you install via Chocolatey, you don't need to run the installers from the products' respective sites.


View 0_reuse_code.js
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
View EnsureModelStateIsValid.cs
/// <summary>
/// This action filter ensures ModelState.IsValid is true as a precondition to entry into the MVC action
/// </summary>
/// <remarks>
/// This class also validates all action parameters unlike the default behavior of ModelState.IsValid
/// </remarks>
/// <see cref="" />
public class EnsureModelStateIsValid : ActionFilterAttribute
private static readonly ConcurrentDictionary<MethodInfo, ParameterInfo[]> MethodCache
View Base58.cs
/// <summary>
/// Base58 is case SENSITIVE alphanumeric ELIMINATING: 0 (zero) I (uppercase), O (upppercase), l (lowercase)
/// This reduction of characters eliminates the majority of human typoposition errors
/// </summary>
public class Base58
private const string Base58Digits = "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";
private static readonly char[] Base58Chars = Base58Digits.ToCharArray();
View OrdinalIgnoreCaseString.cs
struct OrdinalIgnoreCaseString : IEquatable<OrdinalIgnoreCaseString>, IEquatable<string> {
string _str;
public OrdinalIgnoreCaseString(string str) {
_str = str;
public static implicit operator OrdinalIgnoreCaseString(string str) {
return new OrdinalIgnoreCaseString(str);
View jquery-observe.js
(function(d) {
d.Observe = {}
(function(d, q) {
var r = function(e, f) {
f || (f = e, e = window.document);
var m = [];
d(f).each(function() {
for (var l = [], g = d(this), h = g.parent(); h.length && !; h = h.parent()) {
var f = g.get(0).tagName.toLowerCase();
View My Git aliases
co = checkout
ci = commit
branches = branch
syncdev = "!git fetch origin; git merge origin/development"
up-c = checkout -f
View 1 - Map Arguments to Properties.cs
// Runnable from Linqpad 5
// Must install the Sigil nuget package and include the Sigil namespace
void Main()
var createSample = GetMapperDelegate();
// try it out
createSample(23, "Hello").Dump();
View PageDown Headings that support H1-H4
//replace this method
commandProto.doHeading = function (chunk, postProcessing) {
// Remove leading/trailing whitespace and reduce internal spaces to single spaces.
chunk.selection = chunk.selection.replace(/\s+/g, " ");
chunk.selection = chunk.selection.replace(/(^\s+|\s+$)/g, "");
// If we clicked the button with no selected text, we just
// make a level 2 hash header around some default text.
if (!chunk.selection) {
chunk.startTag = "#### "; /* rewrite to start at H4 instead */
View StyleRelativePathTransform
public class StyleRelativePathTransform : IBundleTransform
private const string UrlPattern = @"url\s*\(\s*([""']?)([^:)]+)\1\s*\)";
private static readonly Regex UrlRegex = new Regex(UrlPattern, RegexOptions.IgnoreCase | RegexOptions.Compiled);
public void Process(BundleContext context, BundleResponse response)
var mergedCss = new StringBuilder();