Add promise snippet

Useful boilerplate promise function