Skip to content

Instantly share code, notes, and snippets.

Macros

Proteins

  • 24g Whey Protein
  • 24g Whey Protein
  • 24g Whey Protein

72g Whey Protein

@jamesflorentino
jamesflorentino / convert.sh
Last active September 20, 2016 10:54
Makefile for creating favicons from 16x16 up to 128x128.
convert favicon.png -resize 16x16 favicon.ico;
convert favicon.png -resize 16x16 favicon_16x16.png;
convert favicon.png -resize 32x32 favicon_32x32.png;
convert favicon.png -resize 64x64 favicon_64x64.png;
convert favicon.png -resize 128x128 favicon_128x128.png;
echo "conversion complete";
// NPC by cmwelsh
//#CLIENTSIDE
client.players = function(players) {
client.on('chat', function(playerID) {
players.get(playerID, function(player) {
player.move(30, 35);
});
});
};
ready(function(err, socket) {
createGameModel(function(err, game) {
createStage(function(err, stage) {
socket.on('entity.create', function(data) {
game.createEntity(data, function(entity) {
entity.say('hi!');
stage.createSpriteFromEntity(entity, function(sprite) {
// Basic entity-component closure
function Component(api) {
return function(entity) {
for(var key in api) {
if (api.hasOwnProperty(key)) {
entity[key] = api[key];
}
}
}
}
// Basic entity-component closure
function Component(api) {
return function(entity) {
for(var key in api) {
if (api.hasOwnProperty(key)) {
entity[key] = api[key];
}
}
}
}
//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
@jamesflorentino
jamesflorentino / client.js
Last active December 20, 2015 14:49
client.js
/** client.js **/
var https = require('https');
var url = require('url');
function Client() {}
/**
* All initialization code should be here.
*/
Client.prototype.initialize = function() {};
@jamesflorentino
jamesflorentino / compare.js
Created August 18, 2013 04:11
Bato bato pik
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') {
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';