Skip to content

Instantly share code, notes, and snippets.

@alansikora
Created June 26, 2012 19:32
Show Gist options
  • Save alansikora/2998283 to your computer and use it in GitHub Desktop.
Save alansikora/2998283 to your computer and use it in GitHub Desktop.
'click .increment': function() {
voteOnLeaderboard("players", function() {
Players.update(this._id, {
$inc: { score: 1 }
});
});
}
function voteOnLeaderboard(name, callback) {
storage_name = "voted-on-" + name + "-leaderboard";
if (localStorage.getItem(storage_name) != null) return false;
localStorage.setItem(storage_name, true);
callback()
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment