This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.core.management.base import BaseCommand | |
# from django.core.management.base import CommandError | |
from optparse import make_option | |
from django.conf import settings | |
from subprocess import call | |
import os | |
import sys | |
""" | |
""" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// GServiceGateway.h | |
// | |
// | |
#import <Foundation/Foundation.h> | |
@interface GServiceGateway : NSObject | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
from django.core.management.base import BaseCommand | |
# from django.core.management.base import CommandError | |
from optparse import make_option | |
from django.conf import settings | |
import os | |
import sys | |
import yaml | |
from boto.s3.connection import S3Connection |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class EventDispatcher(object): | |
def __init__(self): | |
self._events = {} | |
def on(self, type, handler): | |
handlers = self._events.setdefault(type, []) | |
handlers.append(handler) | |
def emit(self, type, *args, **kwargs): | |
try: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var util = exports || {}; | |
util.mergeDeep = function (A, B, depth) { | |
var forever = depth == null; | |
for (var p in B) { | |
if (B[p] != null && B[p].constructor==Object && (forever || depth > 0)) { | |
A[p] = util.mergeDeep( | |
A.hasOwnProperty(p) ? A[p] : {}, | |
B[p], |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function(exports, name, $){ | |
var GPub = function(){}; | |
GPub.observable = function(src){ | |
var _o = $({}), _l = {}, obj = src || {}; | |
var _d = function(e){ (e in _l) && (_l[e] -= 1); }; | |
var _a = function(e){ (e in _l) || (_l[e] = 0); _l[e] += 1; }; | |
obj.on = function() { _o.on.apply(_o, arguments); _a(arguments[0]); return this;}; | |
obj.off = function() { _o.off.apply(_o, arguments); _d(arguments[0]); return this;}; | |
obj.emit = function() { _o.trigger.apply(_o, arguments); return this;}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Promise () { | |
this._resolve = []; | |
this._reject = []; | |
this._progress = []; | |
} | |
Promise.prototype = { | |
/* This is the "front end" API. */ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<title>WebSocket Client</title> | |
<style> | |
#output { | |
border: solid 1px #000; | |
} | |
</style> | |
</head> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# WE CAN ALSO ENABLE CORS IN htaccess | |
# with AJAX withCredentials=false (cookies NOT sent) | |
Header always set Access-Control-Allow-Origin "*" | |
Header always set Access-Control-Allow-Methods "POST, GET, PUT, OPTIONS, PATCH, DELETE" | |
Header always set Access-Control-Allow-Headers "X-Accept-Charset,X-Accept,Content-Type" | |
RewriteEngine On | |
RewriteCond %{REQUEST_METHOD} OPTIONS | |
RewriteRule ^(.*)$ $1 [R=200,L,E=HTTP_ORIGIN:%{HTTP:ORIGIN}]] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function urlObject(url, options) | |
{ | |
if ("" === url) return null; | |
default_options = {'url':url,'unescape':true,'convert_num':true}; | |
if(typeof options !== "object") | |
options = default_options; | |
else | |
{ |