Skip to content

Instantly share code, notes, and snippets.

@slaneyrw
slaneyrw / LoginController.cs
Last active April 2, 2017 16:13
Handle context switch from MVC to IdentityServer
using IdentityModel;
using IdentityServer3.Core.Extensions;
using Microsoft.AspNet.Identity;
using Microsoft.Owin.Infrastructure;
using System;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Linq;
using System.Threading.Tasks;
using System.Web;
@slaneyrw
slaneyrw / gist:4721445
Last active December 12, 2015 05:28
Convert a text representing a number to a currency word version.
public static class NumberWordConverter
{
#region Lookups
private static readonly Dictionary<char, string> units = new Dictionary<char, string>()
{
{'0', ""},
{'1', " One"},
{'2', " Two"},
{'3', " Three"},
/// <reference path="../Scripts/jquery-1.8.3.js"/>
/// <reference path="../Scripts/knockout-2.2.0.debug.js"/>
/// <reference path="../Scripts/linq.js" src="http://linqjs.codeplex.com/" />
/// <reference path="glimpse.js" />
var koInstrumentation = (function(window, ko, glimspe) {
// Sanity check dependencies
if (ko === undefined || ko === null ) {
console.log("Knockout library missing or not loaded before KnockoutInstrumentration");