EXAMPLES FROM THE WEB FOR HAT TRICK
It played the "hat trick" with the gentility of modern manners.
1879, originally from cricket, "taking three wickets on three consecutive deliveries;" extended to other sports (especially ice hockey) c.1909. Allegedly because it entitled the bowler to receive a hat from his club commemorating the feat (or entitled him to pass the hat for a cash collection), but also influenced by the image of a conjurer pulling things from his hat (attested by 1876). The term was used earlier for a different sort of magic trick: