Some useful pieces of code