This file contains 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
// Google analytics implementation | |
window.Analytics = (function(ga) { | |
function Analytics() { } | |
Analytics.prototype.trackEvent = function(category, action, label, value) { | |
ga.apply(this, ['send', 'event'].concat(Array.prototype.slice.call(arguments))); | |
}; | |
Analytics.prototype.trackPage = function(options) { | |
ga.apply(this, ['send', 'pageview'].concat(Array.prototype.slice.call(arguments))); |
This file contains 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
def shape_factory(type, *args, **kwargs): | |
if type == "Circle": return Circle(*args, **kwargs) | |
elif type == "Square": return Square(*args, **kwargs) | |
else: None | |
class Shape(object): | |
def draw(self): | |
raise NotImplementedError() | |
def erase(self): |
This file contains 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 App.SignMiddleware | |
constructor: (@gameData, callback) -> | |
@name = 'requestSign' | |
@sessionKey = null | |
Psycho.ajax | |
url: "#{@gameData.endpointUrl}user/getSessionKey" | |
type: 'POST' | |
data: @_signRequestParams { userId: @gameData.userId } |
This file contains 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
import md5 | |
import urllib | |
import urllib2 | |
import uuid | |
import xml.dom.minidom | |
""" | |
chatterbotapi | |
Copyright (C) 2011 pierredavidbelanger@gmail.com |
This file contains 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
COFFEEC = ./node_modules/.bin/coffee | |
DIST = dist | |
CONF = src/conf | |
all: build_dev build_prod | |
build_dev: | |
@$(COFFEEC) --join $(DIST)/lib-dev.js --compile src/lib.coffee $(CONF)/conf-dev.coffee | |
@echo 'Lib(Dev) successfully builded' |
This file contains 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
# | |
# Slightly tighter CORS config for nginx | |
# | |
# A modification of https://gist.github.com/1064640/ to include a white-list of URLs | |
# | |
# Despite the W3C guidance suggesting that a list of origins can be passed as part of | |
# Access-Control-Allow-Origin headers, several browsers (well, at least Firefox) | |
# don't seem to play nicely with this. | |
# | |
# To avoid the use of 'Access-Control-Allow-Origin: *', use a simple-ish whitelisting |