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.$ = require('jquery-browserify') | |
var Switcher = require('ribcage-switcher') | |
var Base = require('ribcage-view') | |
var switcher = new Switcher({depth: 2, el: $('body')}) | |
switcher.setPane(0, new Base({})) | |
switcher.setPane(1, new Base({})) | |
switcher.render() |
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.$ = require('jquery-browserify') | |
var Switcher = require('ribcage-switcher') | |
var Base = require('ribcage-view') | |
var switcher = new Switcher({depth: 2, el: $('body')}) | |
switcher.setPane(0, new Base({})) | |
switcher.setPane(1, new Base({})) | |
switcher.render() |
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
geddy.model.Conversation.first(params.id, function(err, conversation) { | |
geddy.model.Message.all({conversationId: conversation.id}, {includes: [ 'users']} | |
, function (err, messages) { | |
conversation.messages = messages; | |
}); | |
}) |
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 Backbone = require('backbone') | |
, example = require('./routes/example.js') | |
, _ = require('lodash'); | |
var App = Backbone.router.extend({ | |
initialize: function () { | |
this.route('example', _.bind(example, 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
var createGame = require('voxel-engine') | |
var simplex = require('voxel-simplex-terrain') | |
var url = require('url') | |
var chunkSize = 32 | |
var chunkDistance = 3 | |
var seed | |
var parsedURL = url.parse(window.location.href, true) | |
if (parsedURL.query) seed = parsedURL.query.seed |
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 createGame = require('voxel-engine') | |
function sphereWorld(x, y,z ) { | |
// return the number of the material you want to show up | |
// at the current x, y, z position. | |
// the numbers refer to the games materials array. | |
// 0 is air | |
if (x*x + y*y + z*z > 15*15) return 0 | |
// 3 is dirt | |
return 3 |
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 Main = function () { | |
this.index = function (req, resp, params) { | |
if (this.session.get('test')) { | |
params.test = this.session.get('test'); | |
} else { | |
params.test = null; | |
} |
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
//========================================================================= | |
// controller | |
//========================================================================= | |
this.showOutput = function(req, res, params) { | |
console.log('+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++'); | |
console.log(params); | |
params['errorMessage'] = this.session.get('errorMessage'); | |
params['command'] = this.session.get('command'); | |
params['output'] = this.session.get('output'); |
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
// Send a static file path | |
sendStaticFile = function (p) { | |
staticResp = new response.Response(resp); | |
// May be a path to a directory, with or without a trailing | |
// slash -- any trailing slash has already been stripped by | |
// this point | |
if (fs.statSync(p).isDirectory()) { | |
// TODO: Make the name of any index file configurable | |
<<<<<<< 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
for (var i in ModelDefinition) { | |
if (ModelDefinition.hasOwnProperty(i)) { | |
defined[i] = ModelDefinition[i]; | |
} | |
} |