wget https://storage.googleapis.com/golang/go1.8.linux-armv6l.tar.gz
tar -C /usr/local -xzf go1.8.linux-armv6l.tar.gz
export PATH=$PATH:/usr/local/go/bin
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 removerAcentos( newStringComAcento ) { | |
var string = newStringComAcento; | |
var mapaAcentosHex = { | |
a : /[\xE0-\xE6]/g, | |
A : /[\xC0-\xC6]/g, | |
e : /[\xE8-\xEB]/g, | |
E : /[\xC8-\xCB]/g, | |
i : /[\xEC-\xEF]/g, | |
I : /[\xCC-\xCF]/g, | |
o : /[\xF2-\xF6]/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
/* | |
Copyright 2017 Marcelito Costa | |
https://gist.github.com/marcelitocs/876edd2c70e47f16e595b4dd5f0b6c2d | |
Exemple of use | |
$(".table tbody tr").sortElements(function(a, b){ | |
if(a.data("vencimento") < b.data("vencimento")){ | |
return -1; | |
} | |
if(a.data("vencimento") > b.data("vencimento")){ |
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
let distanceBetweenCoordinates = function(p1, p2){ | |
// distância em metros | |
return Math.sqrt(Math.pow(p1.latitude - p2.latitude, 2) + Math.pow(p1.longitude - p2.longitude, 2)) * 111.319 * 1000; | |
}; |
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
let clone = function(obj) { | |
let copy; | |
// Handle the 3 simple types, and null or undefined | |
if (null === obj || "object" !== typeof obj) return obj; | |
// Handle Date | |
if (obj instanceof Date) { | |
copy = new Date(); | |
copy.setTime(obj.getTime()); |
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
// Retorna um número inteiro rondômico entre min (incluso) e max (incluso) | |
function getRandomIntFromInterval(min, max) { | |
return Math.floor(Math.random() * (max - min + 1)) + min; | |
} |
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
/** | |
* Converts a JS string to a UTF-8 "byte" array. | |
* @param {string} str 16-bit unicode string. | |
* @return {!Array<number>} UTF-8 byte array. | |
*/ | |
function stringToUtf8ByteArray(str) { | |
// TODO(user): Use native implementations if/when available | |
var out = [], p = 0; | |
for (var i = 0; i < str.length; i++) { | |
var c = str.charCodeAt(i); |
Consultar a saúde do servidor:
GET /_cat/health?v
Está yellow?
PUT /.kibana/_settings
{
"index": {
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 extend(){ | |
for(var i=1; i<arguments.length; i++) | |
for(var key in arguments[i]) | |
if(arguments[i].hasOwnProperty(key)) | |
arguments[0][key] = arguments[i][key]; | |
return arguments[0]; | |
} |
OlderNewer