Place your palm flat on the back of the head for a neck chop and knock the hat upwards with the little finger side of the hand.
A few tries and you will see how much force is required to get it to spin 3/4 and land on your foot. You need to flex your foot as much as possible to stop it slipping off.