I tried the one by @j3ang , it worked but had some issues with user preferences not updating (kept getting 500 internal server error)
in the end I made my own alternative with none of these issues, please read my topic at: Disable Email Verification for Discourse Plugin