I've built similar functionality using Hammerspoon, configuration described at http://simonduff.net/hammerspoon/
However, I normally find myself lazy, and normally end up using the trackpad to drag windows to corners and edges to resize (also built with Hammerspoon)