Skip to content

Instantly share code, notes, and snippets.

$Username = "user.name"; #don't include @gmail.com
$Password = "I<3bananas!";
function Get-TimeStamp {return "[{0:MM/dd/yy} {0:HH:mm:ss}]" -f (Get-Date)}
function Send-ToEmail([string]$email){
$message = new-object Net.Mail.MailMessage;
$message.From = "user.name@gmail.com";
$message.To.Add($email);
@n3wc
n3wc / sort sample
Created June 26, 2013 20:48
sort sample
var sort_by = function(field, reverse, primer) {
var key = function(x) {
return primer ? primer(x[field]) : x[field]
};
return function(a, b) {
var A = key(a), B = key(b);
return ((A < B) ? -1 : (A > B) ? +1 : 0) * [-1,1][+!!reverse];
}
};