Something like https://gist.github.com/trans/c28a41353d76a7b78bef ?​