Author: Dmitry Chestnykh No licence is specified. Project homepage: https://gist.github.com/dchest/4582374