Skip to content

Instantly share code, notes, and snippets.

View venturion's full-sized avatar

Felipe Venturino venturion

View GitHub Profile
/*
* 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
})
#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
/* Inicialização */
var mathCaptcha = new MathCaptcha({
selector: '#form'
})
/* Default parameters */
MathCaptcha.defaults = {
selector: '[name=form]',
inputClass: 'form-control',
inputName: 'captcha',
[{
"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.
[{
"codigo_ibge": 5200050,
"nome": "Abadia de Goiás",
"latitude": -16.7573,
"longitude": -49.4412,
"capital": false,
"codigo_uf": 52,
"uf": "GO"
}, {
"codigo_ibge": 3100104,
// 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))
@venturion
venturion / baixar_arquivos_do_repositorio_remoto.txt.txt
Last active October 18, 2020 00:58 — forked from vladimirtsyupko/gist:10964772
Git force pull to overwrite local files
git fetch --all
git reset --hard origin/master
git pull origin master
@venturion
venturion / Deploy com Git
Created August 12, 2021 17:23 — forked from alanyoshida/Deploy com Git
Como fazer deploy para o servidor com o git
###############################################
# Como fazer deploy para o servidor com o git #
###############################################
# Na sua Maquina
# Crie uma pasta
$ mkdir repo && cd repo
# Inicie um repositorio vazio
@venturion
venturion / str_replace_n.php
Created August 19, 2021 20:30 — forked from VijayaSankarN/str_replace_n.php
String replace nth occurrence using PHP
<?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
*/