I often need to diff a file and some pasted text from another application or a remote source. Until now, I was using Meld to paste the text into a new file and then diff that.

Don't ask me why, I just never bothered to look for the appropriate syntax to do this in the CLI.

Here's how to do it:

diff <(pbpaste) path/to/file