This file contains hidden or 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
const mask = (v) => { | |
v=v.replace(/\D/g,"") | |
let len = v.length | |
if (len < 12) { | |
v=v.replace(/(\d{3})(\d)/,"$1.$2") | |
.replace(/(\d{3})(\d)/,"$1.$2") | |
.replace(/(\d{3})(\d{1,2})$/,"$1-$2") | |
} else { | |
v=v.replace(/^(\d{2})(\d)/,"$1.$2") | |
.replace(/^(\d{2})\.(\d{3})(\d)/,"$1.$2.$3") |
This file contains hidden or 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
CREATE EXTERNAL TABLE IF NOT EXISTS Accesslogs( | |
BucketOwner string, | |
Bucket string, | |
RequestDateTime string, | |
RemoteIP string, | |
Requester string, | |
RequestID string, | |
Operation string, |
This file contains hidden or 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
#add 'node_modules' to .gitignore file | |
git rm -r --cached node_modules | |
git commit -m 'Remove the now ignored directory node_modules' | |
git push origin master |
This file contains hidden or 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
"Ser produtivo não está ligado a quantas horas você tem que trabalhar, e sim a quanto trabalha nas horas que tem." | |
Eu |
This file contains hidden or 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 | |
$return = preg_replace( '/\b(\d{2})\D?(\d{3})\D?(\d{3})\D?(\d{4})\D?(\d{2})\b/' , '$1.$2.$3/$4-$5' , $cnpj ); | |
echo $return; |
This file contains hidden or 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
function process_error_backtrace($errno, $errstr, $errfile, $errline, $errcontext) { | |
if(!(error_reporting() & $errno)) | |
return; | |
switch($errno) { | |
case E_WARNING : | |
case E_USER_WARNING : | |
case E_STRICT : | |
case E_NOTICE : | |
case E_USER_NOTICE : | |
$type = 'warning'; |
This file contains hidden or 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
private function validaCPF($cpf = null) { | |
// Verifica se um número foi informado | |
if(empty($cpf)) { | |
return false; | |
} | |
// Elimina possivel mascara | |
$cpf = preg_replace('/[^0-9]/', '', $cpf); | |
$cpf = str_pad($cpf, 11, '0', STR_PAD_LEFT); |
This file contains hidden or 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
UPDATE or_postmeta | |
SET meta_value = REPLACE(meta_value, 'https://www.youtube.com/watch?v=', '') where meta_key like 'yt_video%' |
This file contains hidden or 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
mysqldump -hclubinho.com.br -uclubinho -p clubinhodadidi_com_br > clubinhodadidi_com_br_2408.sql |
This file contains hidden or 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
There is a beauty in simplicity. | |
“If you can't explain it to a six year old, you don't understand it yourself.” | |
― Albert Einstein | |
“Like all magnificent things, it's very simple.” | |
― Natalie Babbitt | |
“Life is really simple, but we insist on making it complicated.” | |
― Confucius |