Useful JS functions I developped