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 inherits = require('inherits'); | |
| var Game = require('crtrdg-gameloop'); | |
| var Entity = require('crtrdg-entity'); | |
| var Keyboard = require('crtrdg-keyboard'); | |
| inherits(Player, Entity); | |
| function Player(options){ | |
| this.position = { | |
| x: options.position.x, |
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
| Marionette.Behaviors.behaviorsLookup = -> | |
| return window.Behaviors = {} |
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 RowView extends Marionette.ItemView | |
| tagName: 'tr' | |
| template: require './row.hbs' | |
| behaviors: | |
| Socket: true |
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 window.Behaviors.Socket extends Marionette.Behavior | |
| onRender: -> | |
| console.log 'asd' |
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 errorObject = {value: null}; | |
| function tryCatch(fn, ctx, args) { | |
| try { | |
| return fn.apply(ctx, args); | |
| } | |
| catch(e) { | |
| errorObject.value = e; | |
| return errorObject; | |
| } | |
| } |
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
| Number::pad = (len) -> | |
| return (new Array(len + 1).join('0') + @).slice(-len) | |
| Date::time = -> | |
| returnValue = '' | |
| returnValue += @getHours().pad(2) + ':' | |
| returnValue += @getMinutes().pad(2) + ':' | |
| returnValue += @getSeconds().pad(2) | |
| return returnValue |
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
| window.App = new Marionette.Application | |
| initialize: -> | |
| @layout = new Layout() | |
| onStart: -> | |
| @layout.render() | |
| @region = @layout.getRegion('main') | |
| onStop: (options) -> | |
| @region.empty() | |
| stop: (options) -> | |
| if @onStop |
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
| @collection.fetch().done => | |
| @layout.getRegion('main').show new ListView | |
| collection: @collection |
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
| Git = require('nodegit') | |
| pathToRepo = require('path').resolve(process.cwd()) | |
| module.exports = (socket, options) -> | |
| Git.Repository.open(pathToRepo) | |
| .then(getStatus) | |
| .then (list) -> | |
| console.log list | |
| getStatus = (repository) -> |
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
| #!/bin/sh | |
| nohup sudo node index.js >/dev/null 2>&1 & | |
| nohup grunt >/dev/null 2>&1 & |