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
prod: | |
rm -rf ./bundle | |
mrt bundle bundle.tgz > /dev/null | |
tar -xzf bundle.tgz | |
rm -r bundle/server/node_modules/fibers | |
cd bundle/server && npm install [email protected] | |
clean: | |
rm -f ./bundle.tgz | |
rm -rf ./bundle |
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
Template.editProperty.helpers({ | |
// Render a template based on the control type. For example, if | |
// this.control.type is 'color', it will render the template with | |
// name="colorControl", if it exists. 'this' context is passed to | |
// the control sub-template when rendering. | |
renderControl: function() { | |
if ( ! (this.control && this.control.type)) | |
throw new Meteor.Error(500, 'type missing'); | |
var template = Template[this.control.type + 'Control']; |
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
Template.inviteModal.rendered = function() { | |
Deps.autorun(function() { | |
if (Session.equals('invite', true)) { | |
$('.modal').modal() | |
.on('hide', function() { | |
Session.set('invite', false); | |
}); | |
} | |
}); | |
} |
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
// key is a string of possibly dotted accessors | |
function prop(obj, key) { | |
var keys = key.split('.'); | |
for (var i in keys) { | |
if (!obj) break; | |
obj = obj[keys[i]]; | |
} | |
return obj; | |
} |
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
<head> | |
<title>keydown</title> | |
</head> | |
<body> | |
{{> hello}} | |
</body> | |
<template name="hello"> | |
<input type="text"> |
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 miniQuery(doc, query) { | |
var collection = new Meteor.Collection(null); | |
collection.insert(doc); | |
return !! collection.findOne(query); | |
} |
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
chatStream = new Meteor.Stream('chat'); | |
if(Meteor.isClient) { | |
sendChat = function(message) { | |
chatStream.emit('message', message); | |
console.log('me: ' + message); | |
}; | |
chatStream.on('message', function(message) { | |
console.log('user: ' + message); |
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
PROJECT=myapp | |
BRANCH=$(shell git branch | sed -n '/\* /s///p') | |
TAG=deploy-${BRANCH}-$(shell echo -n `date +%Y%m%d%H%M%S`) | |
ifeq (${BRANCH}, master) | |
TARGET=${PROJECT}.meteor.com | |
else | |
TARGET=${BRANCH}-${PROJECT}.meteor.com | |
endif |
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
settings.json: | |
``` | |
{"foo": 99} | |
``` | |
app.js | |
``` | |
if (Meteor.isServer) | |
console.log(Meteor.settings.foo); | |
``` |
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
"iron-router": { | |
"git": "https://github.com/EventedMind/iron-router.git", | |
"tag": "v0.6.4" | |
} |
OlderNewer