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
indexOf4Array = function () { | |
if (!Array.indexOf) { | |
Array.prototype.indexOf = function(obj) { | |
var length = this.length; | |
for (var i = 0; i < length; i++) { | |
if (this[i] === obj) { | |
return i; | |
} | |
} | |
return -1; |
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
(function () { | |
if (!window.console) { | |
console = {}; | |
} | |
console.log = console.log || function () { | |
}; | |
console.warn = console.warn || function () { | |
}; | |
console.error = console.error || function () { | |
}; |
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 factorial = (function () | |
{ | |
var lanczos = function (n){ | |
var z = n + 1; | |
var p = [1.000000000190015, 76.18009172947146, -86.50532032941677, 24.01409824083091, -1.231739572450155, 1.208650973866179E-3, -5.395239384953E-6]; | |
/// \frac{\sqrt{2\pi}}{z} | |
var d1 = Math.sqrt(2 * Math.PI) / z; | |
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 guid = (function () { | |
var _randomHex = function () { | |
return (((1+Math.random())*0x10000)|0).toString(16).substring(1); | |
}; | |
var _new = function () { | |
var UUID = []; | |
var n = 8; | |
while (n--) { |
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
public static class ObjectCopy | |
{ | |
/// <summary> | |
/// Clone by Deep Reflection | |
/// </summary> | |
/// <typeparam name="T">Type</typeparam> | |
/// <param name="source">Source Object</param> | |
/// <returns>Clone of Source</returns> | |
public static T Clone<T>(this T source) | |
{ |
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
;"strict"; | |
window.Base64 = { | |
// private property | |
_keyStr: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=", | |
// public method for encoding | |
encode: function (input) { | |
var output = ""; |
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
$mail = New-Object System.Net.Mail.MailMessage | |
$mail.From = New-Object System.Net.Mail.MailAddress($from); | |
$mail.To.Add($to); | |
$mail.Subject = $subject; | |
$mail.Body = $body; | |
$smtp = New-Object System.Net.Mail.SmtpClient($smtpUrl); |
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
# Compiled source # | |
################### | |
*.com | |
*.class | |
*.dll | |
*.exe | |
*.o | |
*.so | |
# Packages # |
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
if (!Array.prototype.remove) { | |
Array.prototype.remove = function () { | |
var what, args = arguments, length = args.length, item; | |
while (length && this.length) { | |
what = args[--length]; | |
while ((item = this.indexOf(what)) !== -1) { | |
this.splice(item, 1); | |
} | |
} | |
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
// Setup OAuthClient for Google | |
if (!string.IsNullOrWhiteSpace(ConfigurationManager.AppSettings["GoogleAppId"]) && !string.IsNullOrWhiteSpace(ConfigurationManager.AppSettings["GoogleAppSecret"])) | |
{ | |
OAuthWebSecurity.RegisterClient(new GoogleOAuth2Client(ConfigurationManager.AppSettings["GoogleAppId"], ConfigurationManager.AppSettings["GoogleAppSecret"]), "Google", extraData); | |
} |
OlderNewer