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 timeout; | |
var batch = []; | |
batcher = function(attributes) { | |
batch.push(attributes); | |
if (! timeout) { | |
// send whatever we have in the queue after 5 seconds | |
timeout = setTimeout(function() { | |
console.log('sending a batch of ' + batch.length + '...'); |
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.foo.helpers({ | |
stepsWithIndex: function() { | |
return _.map(this.steps, function(value, index) { | |
return { | |
index: index, | |
value: value | |
}; | |
}); | |
} | |
}); |
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
... = new SimpleSchema({ | |
password: { | |
label: "Password *", | |
type: String | |
}, | |
passwordConfirm: { | |
label: "Password (Confirm)", | |
type: String, | |
custom: function() { | |
if (this.value !== this.field('password').value) { |
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
http://localhost:3000/enroll-account/vHHzHoBaN5Hc65mye |
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
{ | |
"env": { | |
"browser": true, | |
"meteor": true | |
}, | |
"ecmaFeatures": { | |
"arrowFunctions": true, | |
"blockBindings": true, | |
"classes": true, | |
"defaultParams": true, |
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
if (Meteor.isClient) { | |
StaticPosts = new Mongo.Collection(null); | |
fetchAndInsert('test', StaticPosts, (error, response) => { | |
// ... | |
}); | |
} | |
if (Meteor.isServer) { | |
Meteor.methods({ |
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
Show hidden characters
{ | |
"color_scheme": "Packages/User/SublimeLinter/PlainText (SL).tmTheme", | |
"draw_white_space": "all", | |
"folder_exclude_patterns": | |
[ | |
".svn", | |
".git", | |
".hg", | |
"CVS", | |
".meteor" |
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
/* Meteor's ES6 Javascript linting configuration | |
* | |
* Documentation on rules can be found at: | |
* http://eslint.org/docs/rules/ <- Optionally append the rulename | |
* | |
*/ | |
{ | |
"parser": "babel-eslint", | |
"env": { | |
"browser": true, |
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
{ | |
"extends": ".eslintrc-meteor", | |
"rules": { | |
/** | |
* ES6 Specific | |
*/ | |
"no-var": 0, // http://eslint.org/docs/rules/no-var | |
"prefer-arrow-callback": 1, // http://eslint.org/docs/rules/prefer-arrow-callback | |
"prefer-const": 1, // http://eslint.org/docs/rules/prefer-const | |
"prefer-spread": 1, // http://eslint.org/docs/rules/prefer-spread |
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
// Backend config example | |
// http://jlongster.com/Backend-Apps-with-Webpack--Part-I | |
var path = require('path'); | |
var webpack = require('webpack'); | |
var fs = require('fs'); | |
var nodeModules = {}; | |
fs.readdirSync('node_modules') | |
.filter(function(x) { |