Skip to content

Instantly share code, notes, and snippets.

@shelakel
shelakel / Validation.elm
Created January 15, 2016 12:39
Elm Validation module first try
module Validation
( InputState(Initial, HasError, OK)
, InputValue
, inputValue, getInputValue, setInputValue
, hasError, getError
, required, email, checked
, rules
) where
import List exposing(foldl)
@shelakel
shelakel / service.js
Last active November 12, 2015 14:08
Node.Js 4+ Service + Service Host abstract implementations
"use strict";
const EventEmitter = require("events");
//-----------------------------------------------
// Service
//-----------------------------------------------
// service state
const STATE = Symbol();
@shelakel
shelakel / aspnet_identityless_claims
Created December 12, 2014 11:39
ASP.NET Identity 2.0 Identityless claims based authentication
// App_Start/Startup.Auth.cs
public partial class Startup
{
public void ConfigureAuth(IAppBuilder app)
{
var cookieOptions = new CookieAuthenticationOptions {
AuthenticationType = DefaultAuthenticationTypes.ApplicationCookie,
LoginPath = new PathString("/account/sign-in"),
Provider = new CookieAuthenticationProvider {
OnValidateIdentity = OnValidateIdentity