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
// Client Model | |
CoreIo.Client = SC.Record.extend( | |
/** @scope CoreIo.Client.prototype */ { | |
primaryKey: 'id', | |
title: SC.Record.attr(String), | |
stat: SC.Record.attr(Number, {key: 'status'}), | |
created: SC.Record.attr(SC.DateTime, {format: '%Y-%m-%d %H:%M:%S'}), | |
updated: SC.Record.attr(SC.DateTime, {format: '%Y-%m-%d %H:%M:%S'}), | |
brands: SC.Record.toMany('CoreIo.Brand', {isMaster: YES, inverse: 'client'}), |
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
// libs | |
var flatiron = require('flatiron'); | |
var fs = require('fs'); | |
// create app | |
var app = flatiron.app; | |
app.use(flatiron.plugins.http); | |
// router logic | |
app.router.get('/', function () { |
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
App.Project = DS.Model.extend({ | |
}); | |
App.Issue = DS.Model.extend({ | |
project: DS.hasOne('App.Project') | |
}); | |
var issue = App.store.create(App.Issue, { | |
project: App.projectControllet.get('content') |
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
var fs = require('fs'), | |
// CONFIG OPTIONS | |
basePath = './static/js/', | |
buildPath = basePath + 'build/app.js', | |
templatePath = basePath + 'templates/' | |
filePaths = [ | |
'libs/jquery.js', | |
'libs/ember.js', | |
'libs/ember-data.js', |
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
var players = { | |
324234: { | |
x: 100, | |
y: 100 | |
} | |
}; | |
socket.on('message', function (data) { | |
if (data.type === 'move') { |
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
Z = Ember.Application.create({ | |
ready: function () { | |
this.initialize(); | |
} | |
}); | |
Z.ApplicationController = Ember.Controller.extend(); | |
Z.ApplicationView = Ember.View.extend({ | |
templateName: 'application' | |
}); |
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
Z.Router = Ember.Router.extend({ | |
root: Ember.Route.extend({ | |
showInventory: Ember.State.transitionTo('inventory'), | |
showSkills: Ember.State.transitionTo('skills'), | |
close: Ember.State.transitionTo('index'), | |
exit: function (router) { | |
console.log('exit', 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
glob.sync(__dirname + '/public/js/templates/**/*.html').forEach(function (file) { | |
var path = file.split('/'); | |
var fileName = path[path.length - 1]; | |
var templateName = fileName.replace('.html', ''); | |
var html = fs.readFileSync(file, 'utf8'); | |
var dest = __dirname + '/public/js/.tmp/' + templateName + '.js'; | |
html = html.replace(new RegExp('"', 'g'), '\\"'); | |
html = html.replace(/[\r\n]/g, ''); |
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
var util = require('util'); | |
function Foo () { | |
// Constructor function | |
} | |
function Bar () { | |
// Call foo's constructor | |
Foo.call(this, 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
{ | |
"dependencies": { | |
"flatiron": { | |
"version": "0.2.8", | |
"dependencies": { | |
"broadway": { | |
"version": "0.2.5", | |
"dependencies": { | |
"cliff": { | |
"version": "0.1.8", |
OlderNewer