Today I heard the phrase なんてことしてくれた, as in:
君!なんてことしてくれたんだ!
which I learned means "Look what you've done". I thought くれる was only used when someone does something nice for you. Is this just a set phrase, where くれる is being used sarcastically, or are there other times you can use くれる when someone does something you don't like?