Skip to content

Instantly share code, notes, and snippets.

Simon Dickson simonhdickson

  • London, UK
Block or report user

Report or block simonhdickson

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View keybase.md

Keybase proof

I hereby claim:

  • I am simonhdickson on github.
  • I am simonhdickson (https://keybase.io/simonhdickson) on keybase.
  • I have a public key ASCse-S5cVnTAWCZ7cJ3Sy2lpefTh3cd2z9hbZEkoG7Y2Qo

To claim this, I am signing this object:

View patternfunc
let (|MyPattern|_|) (|Number|_|) = function
| Number 1 -> Some MyPattern
| _ -> None
let doSomething = function 1 -> Some 1 | _ -> None
match 1 with
| MyPattern doSomething -> ()
| _ -> ()
@simonhdickson
simonhdickson / TokenValidationAttribute.cs
Last active Mar 21, 2017
Using a facebook token to authenticate your web api
View TokenValidationAttribute.cs
public class TokenValidationAttribute : ActionFilterAttribute
{
public override void OnActionExecuting(HttpActionContext actionContext)
{
var token = actionContext.Request.Headers.GetValues("Token").First();
if (this.IsTokenValid(token))
{
base.OnActionExecuting(actionContext);
return;
}
You can’t perform that action at this time.