Skip to content

Instantly share code, notes, and snippets.

View davidwhitney's full-sized avatar
🍸
You're all wonderful. That's what's happening.

David Whitney davidwhitney

🍸
You're all wonderful. That's what's happening.
View GitHub Profile
@davidwhitney
davidwhitney / gist:7679f8490d9a31794a12
Created December 29, 2014 11:12
Deployments in .NET 2014
RespondentID,CollectorID,StartDate,EndDate,IP Address,Email Address,First Name,LastName,Custom Data,"Broadly, where do you host your software?","What do you use for deployments of your .NET software today?",,,,,,,,,,,,,,,,,,,,,,,"My hosting environment is...","Would you recommend the deployment tech you use?","Comments?"
3630646923,60665721,12/05/2014 22:32:35,12/05/2014 22:33:30,"66.87.143.234","","","","","On Prem with Virtualisation",,"Octopus Deploy",,,,,,,,,"NuGet",,,"Atlassian Bamboo",,,,,,,,,,"Multiple self managed servers in a cluster","With reservations",
3629777943,60665721,12/05/2014 16:05:24,12/05/2014 16:06:30,"83.251.67.247","","","","","Microsoft Azure","MSDeploy",,,,,,,"Azure Websites Deployments / Project Kudu",,,,"TeamCity and Scripting",,,,,"AppHarbor Git Deploy",,,,,,,"A load balanced web farm","Yes",
3629682724,60665721,12/05/2014 15:28:25,12/05/2014 15:29:18,"88.168.236.26","","","","","Dedicated VPS","MSDeploy",,,"Chef",,,,,,,"NuGet",,,,,,,,,,,,,"A load balanced web farm","With reserv
$/
  docs/
  src/
  tests/
  samples/
  artifacts/
  packages/
  build/
 lib/
public abstract class BaseModule : NancyModule
{
protected readonly int Version;
protected BaseModule(string moduleName, int? version)
: base((version == null ? "/" : "/v" + version) + "/" + moduleName)
{
Version = !version.HasValue ? 1 : version.Value;
}
}
@davidwhitney
davidwhitney / DocumentDbStore.cs
Last active August 29, 2015 14:05
DocumentDb repo for Azure DocumentDb
public class DocumentDbStore : IStorage
{
private string endpoint = "rootUri";
private string authKey = "key";
private readonly DocumentClient _client;
private readonly DocumentCollection _col;
public DocumentDbStore()
{
https://docs.google.com/a/davidwhitney.co.uk/presentation/d/1eDD5cyT-oXwqzuutZlnBQoSBFNbCdzxJ0bXw-_DG3sU/edit?usp=docslist_api
https://docs.google.com/a/just-eat.com/presentation/d/1NcjmoZlXo617B1ziIPpVsAXUwlEZ6AOhHUd7kosSdpU/pub?start=false&loop=false&delayms=3000#slide=id.p
@davidwhitney
davidwhitney / gist:10744710
Last active August 29, 2015 13:59
LOLWUT Dynamic expressions!
public class SomeType
{
public string Name { get; set; }
}
const string body = "(MyThing.Name == \"Awesome\")";
var p = Expression.Parameter(typeof (SomeType), "MyThing");
var e = DynamicExpression.ParseLambda(new[] {p}, null, body);
@davidwhitney
davidwhitney / gist:10020016
Created April 7, 2014 13:11
day of week kata
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using NUnit.Framework;
namespace dayofweekkata
{
public class PrettyPrinter
@davidwhitney
davidwhitney / ExpressionSortingExtensions.cs
Last active January 2, 2016 00:09
Expression sorting
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Linq.Expressions;
namespace ExpressionSorting
{
/// <summary>
/// This is a little too clever, it looks like voodoo, but it makes the higher level API totally beautiful.
@davidwhitney
davidwhitney / ID3tag
Created December 9, 2013 11:49
ID3 tag kata
The MP3 file format, didn't provide any means for including metadata about the song. ID3 tags were invented to solve this problem.
You can tell if an MP3 file includes ID3 tags by examining the last 128 bytes of the file. If they begin with the characters TAG, you have found an ID3 tag. The format of the tag is as follows:
TAG song artist album year comment genre
The spec is here: http://id3.org/ID3v1