Hide uninteresting files in dired-mode

I just found a neat trick today i.e hiding uninteresting(temporary files like backup or autosave files, all files of a particular extension or a particular set of files which match a regexp) files in dired-mode using dired-x. Here’s how I did it in my .emacs :-