Create thutils.py

Stuff that I wrote in the past which could be helpful