Skip to content

Instantly share code, notes, and snippets.

@zulfajuniadi
Created November 26, 2012 15:55
Show Gist options
  • Save zulfajuniadi/4148925 to your computer and use it in GitHub Desktop.
Save zulfajuniadi/4148925 to your computer and use it in GitHub Desktop.
meteor common helpers
function eventActions(arg){
var action = [
'created a new task.',
'started a task.',
'finished a task.',
'checked a task.',
'commented on a task.'
];
if(_.isNumber(arg)){
return action[arg];
}
else return action;
}
function unixTime(){
return Math.round((new Date()).getTime() / 1000);
}
$.fn.genHandle = function(target){
var that = $(this);
$(that).keyup(function(){
s = $(that).val();
$(target).val('@' + s.replace(/[aeiou\s]/gi,'').toLowerCase());
})
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment