Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am mrsheepuk on github.
  • I am mrsheepuk (https://keybase.io/mrsheepuk) on keybase.
  • I have a public key ASCuqjd3Mdwf8R66rW9Hn_dZ0Y5KJnNsJLyAx2_LW_eeHAo

To claim this, I am signing this object:

@mrsheepuk
mrsheepuk / AutoPrefixingRouteConvention.cs
Created October 21, 2015 12:26
Prefixing all MVC6 / Web API routes with a configured value
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNet.Mvc.ApplicationModels;
using Microsoft.AspNet.Mvc;
namespace MrSheep.Shared
{
public class AutoPrefixingRouteConvention : IApplicationModelConvention
@mrsheepuk
mrsheepuk / gulpfile.js
Last active November 8, 2015 12:32
All-singing all-dancing gulpfile for all sorts of boilerplatey things
/// <binding BeforeBuild='build' AfterBuild='test' Clean='clean' />
var gulp = require("gulp"),
rimraf = require("rimraf"),
concat = require("gulp-concat"),
cssmin = require("gulp-minify-css"),
uglify = require("gulp-uglify"),
inject = require("gulp-inject"),
angularFilesort = require("gulp-angular-filesort"),
mainBowerFiles = require("main-bower-files"),
flatten = require("gulp-flatten"),
@mrsheepuk
mrsheepuk / test.spec.js
Created March 9, 2015 15:25
Mocking dependencies for a jasmine test of an angular controller (using controllerAs syntax)
var mockConnApi = null;
var mockARF = null;
var mockAR = null;
var testData = {
gwSummary: {},
ifStats: {
if_1: {},
if_2: {}
},
@mrsheepuk
mrsheepuk / hbcompiler.js
Last active August 29, 2015 14:08
Using PhantomJS to pre-compile handlebars templates without node
/*
* PhantomJS Runner Handlebars Pre-compiler
*
* PhantomJS binaries: http://phantomjs.org/download.html
* Requires: PhantomJS 1.6+ (1.7+ recommended)
* Requires: handlebars.js, jquery.js
*
* Run with:
* phantomjs hbcompiler.js
* [url-or-path-of-your-uncompiled-templates]