Skip to content

Instantly share code, notes, and snippets.

wshaddix / WebHooksController.cs
Last active Nov 13, 2015
Asp.Net Web API Controller - HEAD
View WebHooksController.cs
using Microsoft.AspNet.Mvc;
namespace kanbanflow_slack.Controllers
public class WebHooksController : Controller
// HEAD: api/webhooks
public void Head()
View main.go
package main
import (
func main() {
wshaddix / gist:82525200ed5ca0395fde
Created Apr 7, 2015
Wrong way to do aurelia dependencies
View gist:82525200ed5ca0395fde
import {HttpClient} from 'aurelia-http-client';
import {Router} from 'aurelia-router';
import {Config} from './my-configurations';
import humane from 'humane';
export class Support {
static inject() { return [HttpClient, Router, Config]; }
constructor(http, router, config){
this.heading = 'Get In Touch';
this.fullName = '';
wshaddix / StructureMapDependencyResolver.cs
Created Jul 29, 2014
A custom dependency resolver for Asp.Net MVC 5 that utilizes StructureMap for dependency resolution
View StructureMapDependencyResolver.cs
using Microsoft.Practices.ServiceLocation;
using StructureMap;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
namespace Insiders.Web.Infrastructure.IoC
public class StructureMapDependencyResolver : ServiceLocatorImplBase
wshaddix / IoC.cs
Created Jul 29, 2014
IoC Class for minimal configuration of Rollbar logging and StatHat stats
View IoC.cs
using System.Configuration;
using Insiders.Web.Infrastructure.Logging.Implementation;
using Insiders.Web.Infrastructure.Logging.Interfaces;
using Insiders.Web.Infrastructure.Stats.Implementation;
using Insiders.Web.Infrastructure.Stats.Interfaces;
using StructureMap;
using StructureMap.Graph;
namespace Insiders.Web.Infrastructure.IoC
View RollbarLogger.cs
using Insiders.Web.Infrastructure.Logging.Interfaces;
using Insiders.Web.Infrastructure.Stats.Interfaces;
using Newtonsoft.Json;
using RollbarSharp;
using System.Runtime.CompilerServices;
namespace Insiders.Web.Infrastructure.Logging.Implementation
public class RollbarLogger : ILog
wshaddix / ILog.cs
Created Jul 29, 2014
ILog Interface
View ILog.cs
using System.Runtime.CompilerServices;
namespace Insiders.Web.Infrastructure.Logging.Interfaces
public interface ILog
void Debug(string message, [CallerMemberName] string memberName = "");
void Debug(object data, [CallerMemberName] string memberName = "");
wshaddix / CookieTempDataProvider.cs
Created May 22, 2014
Cookie based TempData provider for Asp.Net MVC applications that don't want to use Session to store TempData content
View CookieTempDataProvider.cs
public class CookieTempDataProvider : ITempDataProvider
private const string CookieName = "TempData";
private readonly IFormatter _formatter;
public CookieTempDataProvider()
_formatter = new BinaryFormatter();
wshaddix / UiControllerBase.cs
Last active Aug 29, 2015
Asp.Net MVC UI Controller Base Class
View UiControllerBase.cs
public abstract class UiControllerBase : Controller
private readonly ILog _log;
protected UiControllerBase(ILog log)
_log = log;
internal string LoggedInUsername
View gist:9774709
// get the password from the user
var clearTextPassword = "Passw0rd";
// create the password hash
var passwordHash = PasswordHash.CreateHash(clearTextPassword);
// store the password hash in a data store
// ...
// (later when the user tries to login)
You can’t perform that action at this time.