function formatCnpjCpf($value)
{
$cnpj_cpf = preg_replace("/\D/", '', $value);
if (strlen($cnpj_cpf) === 11) {
return preg_replace("/(\d{3})(\d{3})(\d{3})(\d{2})/", "\$1.\$2.\$3-\$4", $cnpj_cpf);
}
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
# Docker image mariadb 10.2.24 (https://hub.docker.com/_/mariadb) | |
~$ docker run --name mariadb -e MYSQL_ROOT_PASSWORD=root -p 3306:3306 -d docker.io/library/mariadb:10.2.24 --slow-query-log=TRUE --log-output=TABLE | |
# SQL check variables | |
SHOW VARIABLES LIKE 'slow_query%'; | |
SHOW VARIABLES LIKE 'log_output%'; | |
SHOW VARIABLES LIKE 'long_%'; | |
SELECT benchmark(100000000, md5('running query')); | |
SELECT * FROM mysql.slow_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
import store from '@/store' | |
const route = { | |
login: 'login', | |
dashboard: 'dashboard' | |
} | |
export default async (to, from, next) => { | |
// Set head title | |
document.title = (to.meta.title) ? `${to.meta.title} / ${process.env.VUE_APP_FULL_NAME}` : process.env.VUE_APP_FULL_NAME |
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
// https://getbootstrap.com/docs/4.0/components/navs/#tabshow | |
$(document).ready(function(){ | |
if($('#tabsCRUD').length > 0){ | |
let urlAnterior = (localStorage.getItem('url_anterior') != null)? helpers.getPathFromUrl(localStorage.getItem('url_anterior')) : null; | |
let urlAtual = helpers.getPathFromUrl(ATUAL_URL); | |
let tabCookie = Cookies.get('tab_crud'); | |
let activeTab = localStorage.getItem('activeTab'); | |
let btnSubmit = $('.kt-form__actions'); | |
// Verifica se possui cookie (vindo do controller) |
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
#301 Redirects for .htaccess | |
#Redirect a single page: | |
Redirect 301 /pagename.php http://www.domain.com/pagename.html | |
#Redirect an entire site: | |
Redirect 301 / http://www.domain.com/ | |
#Redirect an entire site to a sub folder | |
Redirect 301 / http://www.domain.com/subfolder/ |
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
# | |
# Project specific excludes | |
# | |
tomcat | |
# | |
# Default excludes | |
# |
Laravel Homestead is an official, pre-packaged Vagrant box that provides you a wonderful development environment without requiring you to install PHP, HHVM, a web server, and any other server software on your local machine. Read more...
Download homestead box: