Skip to content

Instantly share code, notes, and snippets.

View limptwiglet's full-sized avatar
🎯
Focusing

Mark Gerrard limptwiglet

🎯
Focusing
View GitHub Profile
@limptwiglet
limptwiglet / gist:3039823
Created July 3, 2012 13:54
App router setup
Z = Ember.Application.create({
ready: function () {
this.initialize();
}
});
Z.ApplicationController = Ember.Controller.extend();
Z.ApplicationView = Ember.View.extend({
templateName: 'application'
});
var players = {
324234: {
x: 100,
y: 100
}
};
socket.on('message', function (data) {
if (data.type === 'move') {
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',
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')
@limptwiglet
limptwiglet / fsf
Created December 13, 2011 13:03
flatiron example
// 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 () {
@limptwiglet
limptwiglet / gist:1064518
Created July 5, 2011 09:03
Create brand method
// 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'}),