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
/* | |
* Fix the transform scale tiles bug in css | |
*/ | |
function fixTiles (element, zIndex = 999) { | |
const element = $(element) | |
element.on('mouseover', (e) => { | |
element.css({ | |
'z-index': 0 | |
}) |
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
#cron jobs | |
php /caminho/para/seu-site/bin/magento cron:run 2>&1 | grep -v "Ran jobs by schedule" >> /caminho/para/seu-site/var/log/magento.cron.log | |
php /caminho/para/seu-site/update/cron.php >> /caminho/para/seu-site/var/log/update.cron.log | |
php /caminho/para/seu-site/bin/magento setup:cron:run >> /caminho/para/seu-site/var/log/setup.cron.log |
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
/* Inicialização */ | |
var mathCaptcha = new MathCaptcha({ | |
selector: '#form' | |
}) | |
/* Default parameters */ | |
MathCaptcha.defaults = { | |
selector: '[name=form]', | |
inputClass: 'form-control', | |
inputName: 'captcha', |
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
[{ | |
"codigo_uf": 11, | |
"uf": "RO", | |
"nome": "Rondônia" | |
}, { | |
"codigo_uf": 12, | |
"uf": "AC", | |
"nome": "Acre" | |
}, { | |
"codigo_uf": 13, |
This file has been truncated, but you can view the full file.
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
[{ | |
"codigo_ibge": 5200050, | |
"nome": "Abadia de Goiás", | |
"latitude": -16.7573, | |
"longitude": -49.4412, | |
"capital": false, | |
"codigo_uf": 52, | |
"uf": "GO" | |
}, { | |
"codigo_ibge": 3100104, |
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
// Dados duplicados | |
const arrayData = [1,2,4,4,4,4,3,3,5,6,8] | |
const noDuplicates = function (arrayData) { | |
// Transformo em Set e depois converto para Array novamente sem as duplicatas | |
return [...new Set(arrayData)] | |
} | |
console.log(noDuplicates(arrayData)) |
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
git fetch --all | |
git reset --hard origin/master | |
git pull origin master |
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
############################################### | |
# Como fazer deploy para o servidor com o git # | |
############################################### | |
# Na sua Maquina | |
# Crie uma pasta | |
$ mkdir repo && cd repo | |
# Inicie um repositorio vazio |
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
<?php | |
/** | |
* String replace nth occurrence | |
* | |
* @param type $search Search string | |
* @param type $replace Replace string | |
* @param type $subject Source string | |
* @param type $occurrence Nth occurrence | |
* @return type Replaced string | |
*/ |