Skip to content

Instantly share code, notes, and snippets.

View cecilphillip's full-sized avatar

Cecil Phillip cecilphillip

View GitHub Profile
@cecilphillip
cecilphillip / Customer.cs
Last active January 22, 2017 18:28
ASP.NET Web API Media-Type Formatter for Gravatar
public class Customer
{
public string FirstName { get; set; }
public string LastName { get; set; }
public String Email { get; set; }
}
@cecilphillip
cecilphillip / rethinkdb_setup_osx.md
Last active January 22, 2017 18:06 — forked from mafrosis/rethinkdb_setup_osx.md
RethinkDB Setup on OSX

RethinkDB Setup on OSX

This guide will get RethinkDB setup and running with a default configuration on OSX. There is also an option for setting RethinkDB to start at boot time on OSX, and a note on upgrading to a more recent RethinkDB version.

First Installation

Install Homebrew if you don't already have it:

@cecilphillip
cecilphillip / LazyDisposable.cs
Last active August 29, 2015 14:25 — forked from jammycakes/LazyDisposable.cs
A subclass of System.Lazy<T> that implements IDisposable and forwards calls to the Dispose method on to the lazily created instance if it exists.
/// <summary>
/// A <see cref="Lazy"/> object that implements <see cref="IDisposable"/>.
/// </summary>
/// <typeparam name="T">
/// The object being lazily created.
/// </typeparam>
public class LazyDisposable<T> : Lazy<T>, IDisposable where T: IDisposable
{
/// <summary>
{
"AL": "Alabama",
"AK": "Alaska",
"AS": "American Samoa",
"AZ": "Arizona",
"AR": "Arkansas",
"CA": "California",
"CO": "Colorado",
"CT": "Connecticut",
"DE": "Delaware",
using System.Collections.Generic;
using System.IO;
namespace Portal.Common.EmbeddedResources
{
public static class EmbeddedResourceTypes
{
public static string GetContentType(string path)
{
return MimeTypes[Path.GetExtension(path)];