Skip to content

Instantly share code, notes, and snippets.

width: 100vw; /* Define a largura da imagem como 100% da largura da tela */
margin-left: calc(-50vw + 50%); /* Centraliza a imagem horizontalmente */
margin-right: calc(-50vw + 50%); /* Centraliza a imagem horizontalmente */
@luizfelipeleite
luizfelipeleite / scripts.js
Last active May 29, 2024 13:50
Máscaras CPF, CNPJ, CEP e Telefone no Cleave
String.prototype.numbers = function () {
'use strict';
var result = '';
if (this.match(/(\d+)/g)) {
result = this.match(/(\d+)/g).join('');
}
return result;
};
( function( $ ) {
@luizfelipeleite
luizfelipeleite / gist:0f6e793a906e998ec31711043baadca0
Created December 4, 2020 17:23
Configuração de ambiente de trabalho Ubuntu
Instalar Chrome
baixar em https://www.google.com/intl/pt-BR/chrome/
na pasta Downloads
abrir o terminal e instalar com
sudo dpkg -i filename
instalar git
sudo apt install git
git config --global user.name "Nome Sobrenome"
git config --global user.email email@dominio.com
criar par de chaves open ssh
@luizfelipeleite
luizfelipeleite / scripts.js
Created December 4, 2020 17:08
Validação CPF/CNPJ com Jquery Mask e PHP
jQuery(document).ready(function($){
jQuery.noConflict();
$('.wpcf7-cpf').mask('000.000.000-00');
$('.wpcf7-cnpj').mask('00.000.000/0000-00');
});
wp-cli: (sempre na pasta do projeto)
wp config set table_prefix av_
exportar base:
wp db export .db/lastest.sql
importar base:
wp db import .db/lasteast.sql
  1. Connect to server

Only first connection to create username and SSH configure:

$ ssh root@domain

Recomended (most secure):

alias wpdebug0='wp config set WP_DEBUG false --raw --type=constant'
alias wpdebug1='wp config set WP_DEBUG true --raw --type=constant'
alias rmdss='find . -name '.DS_Store' -type f -delete'
alias rmnm='find . -name 'node_modules' -type d -delete'
alias rmcv='find . -name 'vendor' -type d -delete'
alias guiau='git update-index --assume-unchange'
alias guinau='git update-index --no-assume-unchange'
alias jpdev1='wp config set JETPACK_DEV_DEBUG true --type=constant --raw'
alias jpdev0='wp config set JETPACK_DEV_DEBUG false --type=constant --raw'
alias wplangupdate='wp language core update && wp language plugin update --all && wp language theme update --all'