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
node_modules |
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
/* sprite is 500x500 by default */ | |
.sprite { | |
background: url(sprites.png) top left no-repeat; | |
} | |
.sprite.sprite-user { | |
background-position: 0px -100px; | |
} | |
/* Use the @2x sprite (1000x1000) only if the browser is capable of high-res display */ |
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 = Ember.Application.create(); | |
App.Router.map(function() { | |
this.route('post', { path: '/:post_id' }); | |
}); | |
posts = [{ | |
id: 0, | |
title: "Rails is omakase", | |
body: "There are lots of à la carte software environments in this world." |
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 App = Ember.Application.create(); | |
App.ApplicationController = Ember.Controller.extend({ | |
bag: ['Protein Shake', 'Training Shoes', 'Steroids', 'Insulin Shots'], | |
home: [], | |
actions: { | |
leaveAtHome: function(items) { | |
items.forEach(function(item) { | |
this.get('bag').removeObject(item); | |
this.get('home').addObject(item); |
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 _dictionary = { | |
'rock,scissors': 'Rock', | |
'rock,paper': 'Paper', | |
'scissors,paper': 'Scissors' | |
}; | |
function compare(a, b) { | |
var result; | |
if (a === b) { | |
result = 'Result is a tie'; |
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
function compare(choice1, choice2) { | |
if (choice1 === choice2) { | |
return 'Result is a tie'; | |
} else if (choice1 === 'rock') { | |
if (choice2 === 'scissors') { | |
return 'Rock wins'; | |
} else if (choice2 === 'paper') { | |
return 'Paper wins'; | |
} | |
} else if (choice1 === 'paper') { |
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.js **/ | |
var https = require('https'); | |
var url = require('url'); | |
function Client() {} | |
/** | |
* All initialization code should be here. | |
*/ | |
Client.prototype.initialize = 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
//To get the GPS coordinate from the mobile browser: | |
navigator.geolocation.getCurrentPosition(function(location) { | |
// location.coords.longitude; | |
// location.coords.latitude; | |
}); | |
//To let the server receive data, you'll need to create a service that will handle your json data. | |
//e.g. in node.js/express |
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
// Basic entity-component closure | |
function Component(api) { | |
return function(entity) { | |
for(var key in api) { | |
if (api.hasOwnProperty(key)) { | |
entity[key] = api[key]; | |
} | |
} | |
} | |
} |
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
// Basic entity-component closure | |
function Component(api) { | |
return function(entity) { | |
for(var key in api) { | |
if (api.hasOwnProperty(key)) { | |
entity[key] = api[key]; | |
} | |
} | |
} | |
} |