Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am mcw0933 on github.
  • I am mattcwilson (https://keybase.io/mattcwilson) on keybase.
  • I have a public key ASA2rm_3LtdgucLyr8L2GJ7Qi5yco_BO9vpjNEfyUnUt1go

To claim this, I am signing this object:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>PayloadContent</key>
<array>
<dict>
<key>PayloadDisplayName</key>
<string>Security &amp; Privacy</string>
<key>PayloadEnabled</key>
@mcw0933
mcw0933 / index.js
Created August 3, 2018 21:28
Prompt #2 - Make Change
"use strict";
let currencyConfig = [{ "quarters": 25}, {"dimes": 10}, {"nickels": 5}, {"pennies": 1 }];
function configure(config) {
currencyConfig = config;
}
function make_change(cents) {
let change = {};
@mcw0933
mcw0933 / Differ.cs
Created January 28, 2014 14:28
Differ - C# class that performs an inspection of two sorted lists to identify differences and orphans.
using System.Collections.Generic;
namespace Console
{
/// <summary>
/// Performs an inspection of two sorted lists to identify differences and orphans.
/// </summary>
class Differ
{
/// <summary>
@mcw0933
mcw0933 / gist:5543526
Created May 8, 2013 20:46
Getting the first page of a fixed document sequence as a reference page to know how to set page orientation. Assumes that all pages in the document are the same size and same orientation as page 1.
/// <summary>
/// Gets the PageOrientation of the first page of a fixed document sequence, based on that page's dimensions.
/// </summary>
/// <param name="docSeq">The fixed document sequence.</param>
/// <returns>
/// If the first page could not be found, returns Unknown.
/// Returns Portrait when the page width is less than the height.
/// Otherwise (width is greater than OR EQUAL), returns Landscape.
/// </returns>
private static PageOrientation GetPageOrientationOfFirstPageOfFixedDocSeq(FixedDocumentSequence docSeq) {