Skip to content

Instantly share code, notes, and snippets.

@ShawInnes
ShawInnes / RepositoryBase.cs
Created February 18, 2014 12:27
CouchBase RepoositoryBase
using Couchbase;
using Couchbase.Extensions;
using Enyim.Caching.Memcached;
using Newtonsoft.Json;
using Newtonsoft.Json.Serialization;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Web;
@ShawInnes
ShawInnes / AutofacFluentValidationModule.cs
Created February 19, 2014 12:42
Autofac Fluent Validation Module (MVC 5)
using Autofac;
using FluentValidation;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
namespace WebSite
{
@ShawInnes
ShawInnes / AutofacValidationFactory.cs
Created February 19, 2014 12:43
Autofac Validation Factory (MVC 5)
using Autofac;
using FluentValidation;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
namespace WebSite
{
@ShawInnes
ShawInnes / AssemblyVersion.tt
Created February 22, 2014 13:43
Automatic AssemblyVersion File - T4 Template
<#@ template debug="false" hostspecific="true" language="C#" #>
<#@ output extension=".cs" #>
<#@ assembly name="EnvDTE" #>
<#@ import namespace="EnvDTE" #>
<#@ import namespace="System.IO" #>
<#
var hostServiceProvider = (IServiceProvider)Host;
var dte =
(EnvDTE.DTE)hostServiceProvider.GetService(typeof(EnvDTE.DTE));
var activeSolutionProjects = (Array)dte.ActiveSolutionProjects;
@ShawInnes
ShawInnes / packages.config
Created February 26, 2014 07:06
All NuGet Packages for All
<package id="Microsoft.Owin.Security" version="3.0.0-alpha1" targetFramework="net451" />
<package id="Microsoft.Owin.Security.Cookies" version="2.1.0" targetFramework="net451" />
<package id="Microsoft.Owin.Security.Facebook" version="2.1.0" targetFramework="net451" />
<package id="Microsoft.Owin.Security.Google" version="2.1.0" targetFramework="net451" />
<package id="Microsoft.Owin.Security.MicrosoftAccount" version="2.1.0" targetFramework="net451" />
<package id="Microsoft.Owin.Security.OAuth" version="2.1.0" targetFramework="net451" />
<package id="Microsoft.Owin.Security.Twitter" version="2.1.0" targetFramework="net451" />
<package id="Microsoft.Owin.Security.WsFederation" version="3.0.0-alpha1" targetFramework="net451" />
<package id="Owin.Security.Providers" version="1.3" targetFramework="net451" />
@ShawInnes
ShawInnes / Startup.cs
Created February 26, 2014 07:07
OWIN Authentication Startup.cs
using System;
using System.Threading.Tasks;
using Microsoft.Owin;
using Owin;
using Owin.Security.Providers.GitHub;
using Owin.Security.Providers.LinkedIn;
using Owin.Security.Providers.Yahoo;
using Owin.Security.Providers.Reddit;
using Microsoft.Owin.Security.WsFederation;
using Microsoft.Owin.Security.Cookies;
@ShawInnes
ShawInnes / ReleaseNotes.cs
Last active August 29, 2015 13:57 — forked from PaulStovell/ReleaseNotes.py
C# Version of Paul Stovell's Release Notes Builder.
//
// Fork of https://gist.github.com/PaulStovell/9593947
// Uses: https://github.com/octokit/octokit.net
// NuGet: Install-Package Octokit
//
var connection = new Connection(new ProductHeaderValue("ReleaseNotesGenerator"));
connection.Credentials = new Credentials(Util.GetPassword("github.username"), Util.GetPassword("github.password"));
var apiConnection = new ApiConnection(connection);
@ShawInnes
ShawInnes / sff2014.md
Last active August 29, 2015 14:00
Spanish Film Festival 2014

Spanish Film Festival 2014

Film Date Time Venue Seat Suncorp
Living is Easy... Thu 1 May 7.00pm Barracks H10
Barcelona Summer Night Fri 2nd May 8.45pm Barracks H10
Alpha Sat 3rd May 4.00pm Barracks H10
Zip & Zap... Sun 4 May 1.45pm Barracks H10 2pm
The Forest Mon 5 May 8.45pm Barracks H10
@ShawInnes
ShawInnes / TestSetup.ps1
Created June 3, 2014 01:06
NUnit Test Goodness
# Paste this into Package Manager Console of Visual Studio
foreach ($thing in @("NUnit", "NUnit.Extensions", "NUnitTestAdapter", "Shouldly")) { Install-Package $thing }
class NullShadowBuilder : View.DragShadowBuilder
{
const int centerOffset = 52;
int width, height;
public NullShadowBuilder (View baseView) : base (baseView)
{
}
public override void OnProvideShadowMetrics (Point shadowSize, Point shadowTouchPoint)