How to disable Android Marshmellow (and higher) Heads Up notifications

Heads Up notifications: helpful sometimes, annoying when you're watching to a video, reading some news, or doing something else.
Some devices, especially Samsung (due to TouchWiz customizations), don't allow its users to control which apps should show these Pop ups, and which apps should be quiet.
But here's a simple way to disable these notifications. This process requires a bit of coding knowlegde, and, unfortunatelly, disables the feature on all of the apps.

Report unpropriate Curation

Please report any unappropriated Curation, some you feel this is over the line as it defense someone or institution. Also something which has a unappropriated ton by religion, skin color, race or anything you feel this should not be published at a Curation!