Does this work for you? https://gist.github.com/Lokaltog/74c61d67b7a0555a726e