Skip to content

Instantly share code, notes, and snippets.

View phillip-haydon's full-sized avatar
💭
Banana's are yellow.

Phillip Haydon phillip-haydon

💭
Banana's are yellow.
View GitHub Profile
<div class="field">
<label>Gender</label>
<div class="ui dropdown selection">
<input type="hidden" name="gender">
<i class="dropdown icon"></i>
<div class="default text">...</div>
<div class="menu">
<div class="item" data-value="male">Male</div>
<div class="item" data-value="female">Female</div>
</div>
When given two routes:
Get["/{name}"] _ => "Hello, " + _.name;
Get["/phillip"] _ => "Phillip is awesome!";
Both these routes are identical, but we need to parse the url against both every time.
http://mysite.com/phillip
^ This route is matched twice.
@phillip-haydon
phillip-haydon / gist:6316587
Last active December 21, 2015 13:59
Weather in New Zealand

In the morning the clouds gather, and they sit and have coffee and discuss the daily plan.

Their conversions are like: "Yo, lets head on over there, and rain on those fuckers, after an hour when they have given up on their plans and got out their umbrella's, we will head on over there, but we wont rain, we will just block out the sun and be assholes, then we will head back where we started and rain on those fuckers again for thinking it was going to be a nice day. Later, we will head down south and be really windy and blow some shit around and make a mess. At about 2pm we will go have a late lunch, before heading back to rain on those fuckers again while they collect their kids from school, ruin their evening, and call it a day."

PM> install-package RavenDB.Embedded -pre
Attempting to resolve dependency 'RavenDB.Database (= 2.5.2653-Unstable)'.
Attempting to resolve dependency 'Microsoft.CompilerServices.AsyncTargetingPack'.
Attempting to resolve dependency 'System.Spatial (≥ 5.2)'.
Attempting to resolve dependency 'WindowsAzure.Storage (≥ 2.0)'.
Attempting to resolve dependency 'Microsoft.Data.OData (≥ 5.2.0)'.
Attempting to resolve dependency 'Microsoft.Data.Edm (= 5.2.0)'.
Attempting to resolve dependency 'Microsoft.WindowsAzure.ConfigurationManager (≥ 1.8.0.0)'.
Attempting to resolve dependency 'RavenDB.Client (= 2.5.2653-Unstable)'.
@phillip-haydon
phillip-haydon / archive.cshtml
Created July 9, 2013 17:31
Sample view for BuildStarted
@inherits Nancy.ViewEngines.Razor.NancyRazorViewBase<Sandra.Snow.PreCompiler.PostData>
@using System.Collections.Generic
@{
Layout = "default.cshtml";
}
<h1>Archives</h1>
@foreach(var year in Model.PostsGroupedByYearThenMonth)
{
public static class Enums
{
public static IList<dynamic> ListFrom<T>()
{
var list = new List<dynamic>();
var enumType = typeof(T);
foreach (var o in Enum.GetValues(enumType))
{
list.Add(new
@echo off
:: ----------------------
:: KUDU Deployment Script
:: ----------------------
:: Setup
:: -----
setlocal enabledelayedexpansion
@phillip-haydon
phillip-haydon / gist:5371088
Created April 12, 2013 10:24
.NET 4 gave us clean config files, then MVC + WebAPI produced this...
<?xml version="1.0" encoding="utf-8"?>
<!--
For more information on how to configure your ASP.NET application, please visit
http://go.microsoft.com/fwlink/?LinkId=169433
-->
<configuration>
<configSections>
<!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=4.4.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
</configSections>
class Program
{
static void Main(string[] args)
{
var bunchOfValues = new List<Banana>
{
new Banana(),
new Banana(),
new Banana(),
new Banana(),
@phillip-haydon
phillip-haydon / gist:5040140
Created February 26, 2013 17:03
Create Message on Amazon SQS with WinRT
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Text;
using NUnit.Framework;
using Windows.Security.Cryptography;
using Windows.Security.Cryptography.Core;