function formatCnpjCpf($value)
{
$CPF_LENGTH = 11;
$cnpj_cpf = preg_replace("/\D/", '', $value);
if (strlen($cnpj_cpf) === $CPF_LENGTH) {
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
<!DOCTYPE html> | |
<html> | |
<body> | |
<p>Click the button to get your coordinates.</p> | |
<button id ='getCoordinates'>Try It</button> | |
<p id='coordinates'></p> |
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
Segue a lista de comandos docker e sua utilidade: | |
docker attach – Acessar dentro do container e trabalhar a partir dele. | |
docker build – A partir de instruções de um arquivo Dockerfile eu possa criar uma imagem. | |
docker commit – Cria uma imagem a partir de um container. | |
docker cp – Copia arquivos ou diretórios do container para o host. | |
docker create – Cria um novo container. | |
docker diff – Exibe as alterações feitas no filesystem do container. | |
docker events – Exibe os eventos do container em tempo real. | |
docker exec – Executa uma instrução dentro do container que está rodando sem precisar atachar nele. |
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
Tags: Sublime Text 2 License Key, Sublime Text 3 License Key, Sublime Text Full Version, Sublime Text 3 version 3103. | |
Go to menu Help > Enter License. | |
—– BEGIN LICENSE —– | |
Michael Barnes | |
Single User License |
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
# Backup | |
docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql | |
# Restore | |
cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE | |
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
[Adblock Plus 2.0] | |
! Title: Evite esses Sites - Fundação Procon/SP | |
! Homepage: http://sistemas.procon.sp.gov.br/evitesite/list/evitesites.php | |
! Expires: 1 day | |
! Last modified: 14 Jan 2016 2:23 UTC | |
! Adaptação para lista de filtragem do Adblock Plus/uBlock Origin por Glauber Lima | |
adorocompraronline.com | |
aikade.com | |
alenic.com.br | |
amorerequinte.com.br |
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
# remove specific file from git cache | |
git rm --cached filename | |
# remove all files from git cache | |
git rm -r --cached . | |
git add . | |
git commit -m ".gitignore is now working" |
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 | |
/* | |
* | |
* Based on (forked from) the work by https://gist.github.com/Kostanos | |
* | |
* This revision allows the PHP file to be included/required in another PHP file and called as a function, rather than focusing on command line usage. | |
* | |
* Convert JSON file to CSV and output it. | |
* | |
* JSON should be an array of objects, dictionaries with simple data structure |
Native HTML controls are a challenge to style. You can style any element in the web platform that uses Shadow DOM with a pseudo element ::pseudo-element
or the /deep/
path selector.
video::webkit-media-controls-timeline {
background-color: lime;
}
video /deep/ input[type=range] {
NewerOlder