Skip to content

Instantly share code, notes, and snippets.

View mdarnall's full-sized avatar

Matt Darnall mdarnall

View GitHub Profile

Keybase proof

I hereby claim:

  • I am mdarnall on github.
  • I am mdarnall (https://keybase.io/mdarnall) on keybase.
  • I have a public key ASD2Z7wgTM0Hl-HaEH1OVsYZ9KPbQFZoF3Xzyu53d8TqCAo

To claim this, I am signing this object:

@mdarnall
mdarnall / BreezeLoginLinks.md
Last active October 5, 2016 21:18
Links from our breeze login talk at DF16
@mdarnall
mdarnall / index.js
Created June 3, 2014 23:37
requirebin sketch
// example using the raf module from npm. try changing some values!
var requestAnimationFrame = require("raf")
var canvas = document.createElement("canvas")
canvas.width = 500
canvas.height = 500
document.body.appendChild(canvas)
var context = canvas.getContext("2d")
// Print all of the news items on hackernews
var jsdom = require('jsdom');
jsdom.env({
html: 'http://news.ycombinator.com/',
scripts: [
'http://code.jquery.com/jquery-1.5.min.js'
],
done: function(errors, window) {
var $ = window.$;
@mdarnall
mdarnall / DeviceRedirect.cs
Created February 20, 2012 23:25
FMMobile Device Redirect
using System;
using System.Web;
namespace TransCore.FMWebMobile.DeviceRedirect
{
public class DeviceRedirectModule : IHttpModule
{
const string COOKIE_NAME = "FMWebFullSite";
private const string MOBILE_PATH = "/m";
@mdarnall
mdarnall / gist:1166041
Created August 23, 2011 18:13
Location
this.Origin = new LocationViewModel
{
RawValue =
TransCore.WebApis.Client.Fluency.Locations.Places.Get(search.Criteria.From).
DisplayText
};
}
abstract class BaseViewModel : IValidatable {
public LocationViewModel Origin { get; set;}
public LocationViewModel Dest { get; set; }
override IEnumerable<ValidationResult> Validate( ValidationContext context ) {
//copy ValidateFMViewModel logic
}
protected abstract LocationsCheckResult Check(string originToCheck, string destToCheck);
@mdarnall
mdarnall / Original Text
Created March 22, 2011 05:55
TIM project Cuke
Given that I am a logged in user
And I have clicked on the Spot Market Tab
And I have subscribed as a Combo Pro Contributor or Combo Premium Contributor
When I Enter the <insert prompt names>
Or enter Lookback options of 7,15,60,90 days or 1 year
Or enter geography options of 3 digit zip, market, area, region
And click “Get Rates” button
Then Avg Linehal should display the calculated figure
using System;
using System.Web.Mvc;
namespace NewInMVC3.ModelBinder
{
public class GenericModelBinderProvider : IModelBinderProvider
{
public IModelBinder GetBinder(Type modelType)
{
var genericType = typeof (IModelBinder<>).MakeGenericType(modelType);
using System;
using System.Web.Mvc;
using StructureMap.Configuration.DSL;
using StructureMap.Graph;
namespace TransCore.FMWebMobile.DependencyResolution
{
internal class ControllerRegistryConvention : IRegistrationConvention
{
public void Process(Type type, Registry registry)