How To Force WooCommerce To Use Email Address As Username When Registering a New Account

This gist will force WooCommerce to use the email address as username when creating new accounts: