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
| $('#inputID').on('input',function(){ | |
| if($(this).val().indexOf('-')!=-1){ | |
| if($(this).val().length==15){ | |
| var _value = $(this).val(); | |
| _value = _value.split(''); | |
| var iTraco = _value.indexOf('-'); | |
| var letterAfter = _value[iTraco+1]; | |
| _value[iTraco] = letterAfter; | |
| _value[iTraco+1] = '-'; | |
| _value = _value.join(''); |
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 Css() { | |
| var regras = []; | |
| function __constructor(){ | |
| $('head').append('<style type="text/css" custom></style>'); | |
| } | |
| this.addRule = function(regra, conteudo) { | |
| return $('style[custom]').append(regra + ' { ' + conteudo + ' } '); | |
| }; |
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 ocDownloadImg($url){ | |
| $filename = end(explode('/', $url)); | |
| $saveIn = DIR_IMAGE . '/downloaded/' . $filename; | |
| $ch = curl_init($url); | |
| $fp = fopen($saveTo, 'wba'); | |
| curl_setopt($ch, CURLOPT_FILE, $fp); | |
| curl_setopt($ch, CURLOPT_HEADER, 0); | |
| curl_exec($ch); | |
| curl_close($ch); | |
| fclose($fp); |
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
| find ./* -type f -name "*.png" -exec optipng -o2 {} \; | |
| find ./* -type f -name "*.jpg" -exec jpegoptim -m70 --strip-all {} \; |
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
| adb shell screencap -p | perl -pe 's/\x0D\x0A/\x0A/g' > screen.png | |
| //http://blog.shvetsov.com/2013/02/grab-android-screenshot-to-computer-via.html |
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 |
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
| 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
| 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
| 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'; |