Skip to content

Instantly share code, notes, and snippets.

View roiavidan's full-sized avatar

Roi Avidan roiavidan

  • pay.com.au
  • Melbourne, Australia
View GitHub Profile

Keybase proof

I hereby claim:

  • I am roiavidan on github.
  • I am ravidan (https://keybase.io/ravidan) on keybase.
  • I have a public key whose fingerprint is 71A2 A2C1 23EE 5C8D A282 6E44 14FC 01E7 570B 5EC3

To claim this, I am signing this object:

### Keybase proof
I hereby claim:
* I am roiavidan on github.
* I am roiavidan (https://keybase.io/roiavidan) on keybase.
* I have a public key ASD2_EtOuLIIhfpUZt4uDcI0SlcSgZ0Yx7K18gxFKnvrBgo
To claim this, I am signing this object:
### Keybase proof
I hereby claim:
* I am roiavidan on github.
* I am roi_iress (https://keybase.io/roi_iress) on keybase.
* I have a public key ASC2QAAsTIYP8yKG-jgbB_Ml2cE3m8A_kBQzYB2B4-WXKQo
To claim this, I am signing this object:
@roiavidan
roiavidan / cancelablePromise.js
Created April 4, 2016 00:03
Simple Cancelable Promise
/*
* A Promise which can be "cancelled".
* This is not related to https://github.com/promises-aplus/cancellation-spec/issues.
*
* I just needed some mechanism to force-reject an on-going promise, and possibly execute a callback on cancellation.
* Hope this example helps someone!
*/
function CancelablePromise(executor, onCancel) {
var cancelFunc;
var cancelable = new Promise(function(resolve, reject) {
import tornado.auth
import tornado.escape
import tornado.httpclient
###
### Windows Live OAuth2 authentication Mixin.
### Based on the FacebookGraphMixin code which ships with Tornado.
### For usage, see the Facebook example: http://tornado.readthedocs.org/en/stable/auth.html#facebook
###
class WindowsLiveOAuth2Mixin(tornado.auth.OAuth2Mixin):