Properly Wrapping Native JavaScript with $q Promises

One of most popular posts ever is the post about how a lot of Angular developers are using $q wrong (specifically $q.defer()). Yes, in the vast majority of cases, you don't really need to create a promise by your own from scratch. But, in some cases it is a valid and powerful tool.