Skip to content

Instantly share code, notes, and snippets.

Router.configure({
layoutTemplate: 'ApplicationLayout',
notFoundTemplate: 'notFound',
yieldTemplates: {
'header': {to: 'heading'}
}
});
function requireLogin(pause){
if (!Meteor.userId()){
Router.configure({
layoutTemplate: 'ApplicationLayout',
notFoundTemplate: 'notFound',
yieldTemplates: {
'header': {to: 'heading'}
}
});
var requireLogin = function(pause){
if (!Meteor.userId()){
Router.configure({
layoutTemplate: 'ApplicationLayout',
notFoundTemplate: 'notFound',
yieldTemplates: {
'header': {to: 'heading'}
}
});
var requireLogin = function(pause){
if (!Meteor.userId()){
function requireLogin(pause){
console.log('requireLogin run')
if (!Meteor.userId()){
if (Meteor.loggingIn()){
this.render('loading');
} else {
console.log('accessDeny');
this.render('accessDenied');
}
pause();
Router.configure({
layoutTemplate: 'ApplicationLayout',
notFoundTemplate: 'notFound',
yieldTemplates: {
'header': {to: 'heading'}
}
});
// function requireLogin(pause){
// if (!Meteor.userId()){
Router.configure({
layoutTemplate: 'ApplicationLayout',
notFoundTemplate: 'notFound',
yieldTemplates: {
'header': {to: 'heading'}
}
});
Router.map(function(){
this.route('postsList', {
@Streemo
Streemo / gist:201d85d05e4a779e5de0
Created October 26, 2014 04:22
Args and Kwargs: What you get to use in the function code block.
def takesArbitraryNumberOfArgs(*args):
return args
#args tuple provided in function scope
def defineArbitraryArgsOnTheFly(**kwargs):
return kwargs
#kwargs dictionary provided in function scope.
x = takesArbitraryNumberOfArgs('bob,234,'lol')
//This node.js file generates a file called pythonfile.py in the CWD.
var fs = require('fs');
python = fs.createWriteStream('pythonfile.py');
python.write('def myfun(*args):\n');
python.write('\tx = 0\n');
python.write('\tfor i in args:\n');
python.write('\t\tx+=i\n');
var bobId = Meteor.users.insert({
profile: {name: 'Bob Jones'}
});
var bob = Meteor.users.findOne({_id: bobId});
for (var i = 0; i < 45; i++) { Posts.insert({
title: 'Test post #' + i,
author: bob.profile.name,
userId: bob._id,
<template name="postsList">
<div class="posts">
{{#each posts}}
{{> postItem}}
{{/each}}
{{# if postsReady}}
{{# unless allPostsLoaded}}
{{listenScroll}}
{{/unless}}