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
export LC_CTYPE=en_US.UTF-8 | |
export LANG=en_US.UTF-8 |
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
$.validator.addMethod('regex', function (value, element, regexp) { | |
var check = false, | |
re = new RegExp(regexp); | |
return this.optional(element) || re.test(value); | |
}, 'Favor verificar os valores digitados.'); | |
/* | |
Exemplo de uso : | |
rules: { |
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 CalcRadiusDistance(lat1, lon1, lat2, lon2) { | |
var RADIUSMILES = 3961, | |
RADIUSKILOMETERS = 6373, | |
latR1 = this.deg2rad(lat1), | |
lonR1 = this.deg2rad(lon1), | |
latR2 = this.deg2rad(lat2), | |
lonR2 = this.deg2rad(lon2), | |
latDifference = latR2 - latR1, | |
lonDifference = lonR2 - lonR1, | |
a = Math.pow(Math.sin(latDifference / 2), 2) + Math.cos(latR1) * Math.cos(latR2) * Math.pow(Math.sin(lonDifference / 2), 2), |
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 (typeof String.prototype.trim !== 'function') { | |
String.prototype.trim = function() { | |
return this.replace(/^\s+|\s+$/g, ''); | |
} | |
} |
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
//Syntax | |
var dupNode = node.cloneNode(deep); | |
/* | |
node -> The node to be cloned. | |
dupNode -> The new node that will be a clone of node | |
deep (Optional) -> | |
[true] if the children of the node should also be cloned, or [ | |
false] to clone only the specified node. |