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
window.post = $('textarea').val() | |
var i = 1; | |
window.post = window.post.replace(/(\n)[^\s](\\*)/g, function(str, p1, offset, s) { | |
return '\n' + i++ + '.'; | |
}); | |
$('textarea').val(window.post); |
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
### | |
When attempting to use Meteor.Collection._publishCursor in publish functions as part of a join, | |
we'll do something like this (as outlined in Discover Meteor's Advanced Publications chapter): | |
Meteor.publish (authorId) -> | |
sub = @ | |
commentHandles = {} | |
unless @userId? | |
return undefined |
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 go; | |
go = Router.go; | |
Session.set('lastRoute', null); | |
Router.go = function() { | |
if (!Session.equals('lastRoute', Router.current().route.path())) { | |
Session.set('lastRoute', Router.current().route.path()); | |
} |