Skip to content

Instantly share code, notes, and snippets.


Keybase proof

I hereby claim:

  • I am ashtonkj on github.
  • I am ashtonkj ( on keybase.
  • I have a public key whose fingerprint is B97C A48C 039B 0181 A3DF B6E6 203B 5112 8471 B8E9

To claim this, I am signing this object:

ashtonkj / CustomModelBinder.fs
Created Sep 9, 2014
WebApi Default Args Binder
View CustomModelBinder.fs
type CustomBinder() =
interface IModelBinder with
member this.BindModel(actionContext:HttpActionContext, bindingContext :ModelBindingContext) =
let qs = HttpUtility.ParseQueryString(actionContext.Request.RequestUri.Query)
bindingContext.Model <-
if (qs.AllKeys |> Seq.exists(fun q -> q.ToLower() = bindingContext.ModelName.ToLower())) then
qs.[bindingContext.ModelName] |> Some
View Maybe.fs
type MaybeBuilder() =
member this.Bind(m,f) = Option.bind f m
member this.Return(m) = Some(m)
let maybe = MaybeBuilder()
// Returns Some (querystring) or None if the let! returns None.
let queryString =
ashtonkj / SOWatch.js
Created Jul 29, 2014
Stack Overflow Chat - Check for New Users
View SOWatch.js
javascript:function somethingChanged(changes) {
changes.forEach( function ( change, i ) {
$("#chat").append('<div class="user-container user-24793 monologue mine catchup-marker catchup-marker-2">
<a href="/users/24793/ashtonkj" class="signature user-24793">
<div class="tiny-signature">
<div class="avatar avatar-16">
<img width="16" height="16" src="" alt="AshtonKJ" title="AshtonKJ">
<div class="username">The Room</div>