Skip to content

Instantly share code, notes, and snippets.

@mkmurray
mkmurray / keybase.md
Created June 4, 2015 04:14
keybase.md

Keybase proof

I hereby claim:

  • I am mkmurray on github.
  • I am mkmurray (https://keybase.io/mkmurray) on keybase.
  • I have a public key whose fingerprint is C873 A5E0 C316 6D92 1249 92BB 20F0 5C22 0037 8A02

To claim this, I am signing this object:

@mkmurray
mkmurray / SomeFubuRegistry.cs
Created April 19, 2013 20:36
Reorder policy to put an error behavior node in front of an input conneg reader node
Policies.Reorder(x =>
{
x.WhatMustBeBefore = node => node is ErrorWrapper;
x.WhatMustBeAfter = node => node is InputNode;
});
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using FubuCore;
using FubuCore.CommandLine;
using FubuCore.Util;
using StructureMap;
using log4net;
@mkmurray
mkmurray / SparkView.spark
Created November 13, 2012 22:53
(Accidental) Nested Spark Bindings
<someElement param1="blah">
<SparkPartial />
</someElement>
@mkmurray
mkmurray / import.rb
Created November 12, 2012 15:51 — forked from dnagir/import.rb
Import a blogger archive to jekyll (octopress version) Allows quotes in titles and fixes categories import
require 'rubygems'
require 'nokogiri'
require 'fileutils'
require 'date'
require 'uri'
# usage: ruby import.rb my-blog.xml
# my-blog.xml is a file from Settings -> Basic -> Export in blogger.
data = File.read ARGV[0]
@mkmurray
mkmurray / UrlTransformationException.cs
Created May 17, 2012 14:07
FubuMVC asset pipeline transformer that finds and replaces an InputModel place holder with its route URL. Helpful in avoiding hard-coding an AJAX URL in your JavaScript asset files (though any asset file type will be feed through this transformer).
using System;
using System.Collections.Generic;
using System.Text;
using FubuMVC.Core.Assets.Files;
namespace Some.Namespace.Here
{
public class UrlTransformationException : Exception
{
string _message;
@mkmurray
mkmurray / fold.cs
Created February 6, 2012 07:16
Fold in F# and C#
// FuncList is a functional "cons" list type with Head value and Tail list
public R Fold<T, R>(this FuncList<T> list, Func<R, T, R> func, R init) {
if (list.IsEmpty) {
return init;
}
else {
var foldState = func(init, list.Head);
return list.Tail.Fold(func, foldState);
}
}
@mkmurray
mkmurray / ConfigureAutoMapperTask.cs
Created April 23, 2011 16:08
ITypeMapper class for custom AutoMapper mappings to be found and wired up conventionally by the IOC container.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using AutoMapper;
using Blah.Blah;
using Blah.Blah.Bootstrap;
using Microsoft.Practices.ServiceLocation;
namespace Blah.Blah.BootstrapperTasks