This file contains hidden or 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
/** | |
* Generating PDF from website screenshot. | |
* | |
* Using iron:router's server-side route and meteorhacks:npm to load Webshot NPM package. | |
* Don't forget to add "webshot": "0.16.0" to your packages.json file. Example: | |
* { | |
* "webshot": "0.16.0" | |
* } | |
* Tried it with bryanmorgan:webshot but it didn't work so sticking to loading NPM package directly. | |
* Thanks to @nate-strauser (https://github.com/nate-strauser). |
This file contains hidden or 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
{ | |
"public" : { | |
"env": "Sandbox", | |
"BT_MERCHANT_ID": "xxxxxxxxxxxxxxxx", | |
"BT_PUBLIC_KEY": "xxxxxxxxxxxxxxxx" | |
}, | |
"private": { | |
"BT_PRIVATE_KEY": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" | |
} | |
} |
This file contains hidden or 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.dashboard.onCreated(function() { | |
var instance = this; | |
instance.autorun(function() { | |
instance.subscribe('items'); | |
}); | |
}); | |
Template.dashboard.helpers({ | |
items: function(){ | |
return Items.find(); |
This file contains hidden or 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
Meteor.publish("items", function() { | |
if ( Roles.userIsInRole(this.userId, 'paid') ) { | |
return Items.find(); | |
} | |
}); |
This file contains hidden or 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
// Define gateway variable | |
var gateway; | |
Meteor.startup(function () { | |
var env; | |
// Pick Braintree environment based on environment defined in Meteor settings. | |
if (Meteor.settings.public.env === 'Production') { | |
env = Braintree.Environment.Production; | |
} else { | |
env = Braintree.Environment.Sandbox; |
This file contains hidden or 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>Braintree Demo</title> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<!-- Braintree --> | |
<script src="https://js.braintreegateway.com/v2/braintree.js"></script> | |
</head> |
This file contains hidden or 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 name="dashboard"> | |
<div class="template-dashboard"> | |
<div class="page-header"> | |
<h1>Dashboard</h1> | |
</div> | |
<ul class="list-group"> | |
{{#each items}} | |
<li class="list-group-item">{{ name }} <span class="label label-default">{{ rating }}</span></li> | |
{{/each}} |
This file contains hidden or 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.dashboard.onCreated(function() { | |
var instance = this; | |
instance.autorun(function() { | |
instance.subscribe('items'); | |
}); | |
}); | |
Template.dashboard.helpers({ | |
items: function(){ | |
return Items.find(); |
This file contains hidden or 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 name="dashboard"> | |
<div class="template-dashboard"> | |
<div class="page-header"> | |
<h1>Dashboard</h1> | |
</div> | |
{{#if showForm}} | |
<h3>Buy access to our list of items!</h3> | |
<form role="form"> |
This file contains hidden or 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.dashboard.onCreated(function() { | |
var instance = this; | |
instance.autorun(function() { | |
instance.subscribe('items'); | |
}); | |
}); | |
Template.dashboard.onRendered(function() { | |
Meteor.call('getClientToken', function(error, clientToken) { | |
if (error) { |
OlderNewer