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
function valida_cpf($cpf) {if (empty($cpf)) {return false; } $cpf = preg_replace("/[^0-9]/", "", $cpf); for ($i = 0; $i <= 9; $i++) {if (str_repeat($i, 11) == $cpf) {return false; } } for ($t = 9; $t < 11; $t++) {for ($d = 0, $c = 0; $c < $t; $c++) {$d += $cpf{$c} * (($t + 1) - $c); } $d = ((10 * $d) % 11) % 10; if ($cpf{$c} != $d) {return false; } } return true; } |
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
function formataCEP($cep) | |
{ | |
$valor = str_replace(array('.','-',','),'',trim($cep)); | |
$tam = strlen($valor); | |
if($tam == 8) | |
{ | |
$p1 = substr($valor,0,5); | |
$p2 = substr($valor,5,3); | |
$resultado = $p1."-".$p2; | |
} |
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
SetEnvIf Host .*local.yetanothersite.* VAR_LOCAL_SITE | |
SetEnvIf Host .*yetanothersitehomolog.com.br.* VAR_HOMOLOG_SITE | |
SetEnvIf Host .*www.yetanothersite.com.br.* VAR_PROD_SITE | |
Order Deny,Allow | |
AuthUserFile /var/../.htpasswd | |
AuthName "Authorized personnel only." | |
AuthType Basic | |
Require valid-user | |
Allow from env=VAR_LOCAL_SITE |
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
<!-- <iframe width="500" height="306" src="//www.youtube.com/embed/xpto?rel=0" frameborder="0" allowfullscreen></iframe> --> | |
<div id="player"></div> | |
<script>var ytVideoId = "xpto";</script>'; | |
<script type="text/javascript"> | |
var player; | |
var timer1 = null; | |
var video_length = 0; | |
var video_percent_curr = 0; | |
var video_percent_last = 0; |
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
$log = $this->Model->getDataSource()->getLog(false, false); | |
debug($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
function AjaxRequest(args) | |
{ | |
try | |
{ | |
$.ajax | |
( | |
{ | |
url: "arquivo.php", | |
type: "POST", | |
data: |
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
function Log($texto) | |
{ | |
$tw = $texto; | |
if (is_array($texto)) | |
{ | |
ob_start(); | |
print_r($texto); | |
$tw = ob_get_contents(); | |
ob_end_clean(); | |
} |
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
switch ($i) | |
{ | |
case 0: | |
echo "i equals 0"; | |
break; | |
case 1: | |
echo "i equals 1"; | |
break; | |
case 2: | |
echo "i equals 2"; |
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
function setToCenterOfParent(obj, parentObj) | |
{ | |
var height = $( obj ).height(); | |
var width = $( obj ).width(); | |
if ( parentObj == window ) { | |
$( obj ).css( 'top', ( $( parentObj ).height() / 2 ) - ( height / 2 ) ); | |
$( obj ).css( 'left', ( $( parentObj ).width() / 2 ) - ( width / 2 ) ); | |
} | |
else { | |
$( obj ).css( 'top', ( $( parentObj ).height() / 2 ) - ( height / 2 ) + $( parentObj ).position().top ); |
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
<script src="http://code.jquery.com/jquery-1.8.3.min.js"></script> |
OlderNewer