The Santa hat on Kongregate's Platform Racing 2 is seasonal. Log in on Christmas Day and it's yours.
If you miss the day itself, keep playing — the hat also shows up as a prize drop, so continued runs will eventually land you one. There's no purchase or code involved.