How to remove query string version number from static files in WordPress

If you are an optimization freak or just want your site performance grade to be the highest as possible in tests sites like Pingdom you know one of the most common issues on a WordPress site is the Remove query strings from static resources issue.