Skip to content

Instantly share code, notes, and snippets.

@rcy
rcy / gist:6065263
Created July 23, 2013 19:13
bootstrap modal meteor
Template.inviteModal.rendered = function() {
Deps.autorun(function() {
if (Session.equals('invite', true)) {
$('.modal').modal()
.on('hide', function() {
Session.set('invite', false);
});
}
});
}
@rcy
rcy / gist:5874878
Created June 27, 2013 08:28
compute a template to render
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'];
@rcy
rcy / gist:5844525
Created June 23, 2013 10:22
Makefile to bundle meteor app to run in production
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