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
-- Logs begin at Fri 2014-08-08 18:44:18 UTC. -- | |
Aug 09 18:39:43 ip-10-0-59-226.ec2.internal sh[14005]: File "/app/api/models.py", line 100, in _get_scheduler | |
Aug 09 18:39:43 ip-10-0-59-226.ec2.internal sh[14005]: self.domain, self.options) | |
Aug 09 18:39:43 ip-10-0-59-226.ec2.internal sh[14005]: File "/app/scheduler/coreos.py", line 26, in __init__ | |
Aug 09 18:39:43 ip-10-0-59-226.ec2.internal sh[14005]: f.write(base64.b64decode(auth)) | |
Aug 09 18:39:43 ip-10-0-59-226.ec2.internal sh[14005]: File "/usr/lib/python2.7/base64.py", line 76, in b64decode | |
Aug 09 18:39:43 ip-10-0-59-226.ec2.internal sh[14005]: raise TypeError(msg) | |
Aug 09 18:39:43 ip-10-0-59-226.ec2.internal sh[14005]: TypeError: Incorrect padding | |
Aug 09 18:39:43 ip-10-0-59-226.ec2.internal sh[14005]: [2014-08-09 12:39:43,935: INFO/MainProcess] Task api.tasks.stop_containers[07ea8c60-ef16-4bcc-ac86-b772c2522ab4] succeeded in 0.0510701110034s: None | |
Aug 09 18:39:44 ip-10-0-59-226.ec2.internal sh[14005]: INFO yogurt-bagpiper: Containers scaled web=1 |
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
unless File.exist?('Gemfile') | |
File.write('Gemfile', <<-GEMFILE) | |
source 'https://rubygems.org' | |
gem 'rails', github: 'rails/rails' | |
gem 'arel', github: 'rails/arel' | |
gem 'sqlite3' | |
GEMFILE | |
system 'bundle' | |
end |
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
isArray = Array.isArray or (obj) -> | |
obj.constructor.toString().indexOf("Array") isnt -1 | |
default_max_listeners = 10 | |
class EventEmitter | |
setMaxListeners: (n) -> | |
@_events.maxListeners = n | |
emit: (type) -> |
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
ObjectSync = require 'object-sync' | |
server = http.createServer() | |
# Hook an ObjectSync instance up to our server. | |
# Define a bunch of handlers for CRUD events. The handlers are | |
# async because they'll likely interact with some kind of database | |
sync = ObjectSync.listen server, | |
# a client wants to delete object with id id | |
destroy: (id, client_sid, callback) -> |
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
<script src="socket.io/socket.io.js"></script> | |
<script src="/coffee/object-sync-client.js"></script> | |
<script> | |
sync = new ObjectSync(); | |
sync.connect(); | |
sync.on('update', function(obj) { | |
switch(obj.type) { | |
case 'player': | |
drawPlayer(obj); | |
break; |
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
crypto = require 'crypto' | |
class FBSession | |
constructor: (@app_id, @app_secret) -> | |
@state = 'logged_out' | |
initialize: (req) => | |
@req = req | |
req.fbSession = () => if @state is 'logged_in' then this else null | |
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
/** | |
* makes sure a function is only executed once | |
* all future runs of the function return the same result instantly | |
* I use this for Jakefiles where tasks should not run twice as dependencies | |
* | |
* by @jonashuckestein | |
*/ | |
var once = function(fn) { | |
var self = this; | |
var ran_once = false; |
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
/** | |
* Nifty function that generates a callback that cannot be executed synchronously | |
* This is useful to circumvent the behaviour of crappy libraries that are not always async | |
* (e.g. if they cache certain results) | |
*/ | |
exports.callAsync = function(original_callback) { | |
// capture scope | |
var self = this; | |
return function() { | |
var args = arguments; |