One-liner:
curl -O https://gist.github.com/pavel-sakun/6192519/raw/090206d38e09207a56a69c93947f48ede122d75c/QLTextFiles.sh | sh
Gist source available at https://gist.github.com/pavel-sakun/6192519.
Found at: https://coderwall.com/p/dlithw
Checked this on my 10.9 Mac and works fine.