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
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
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 isset () { | |
// http://kevin.vanzonneveld.net | |
// + original by: Kevin van Zonneveld (http://kevin.vanzonneveld.net) | |
// + improved by: FremyCompany | |
// + improved by: Onno Marsman | |
// + improved by: Rafał Kukawski | |
// * example 1: isset( undefined, true); | |
// * returns 1: false | |
// * example 2: isset( 'Kevin van Zonneveld' ); | |
// * returns 2: 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
public function colorAverage($rect) | |
{ | |
//$rect = array(x, y, w, h); | |
$im = @imagecreatetruecolor($rect[2], $rect[3]); | |
if (!$im) { return false; } | |
imagecopy($im, $this->info, 0, 0, $rect[0], $rect[1], $rect[2], $rect[3]); | |
$imgW = $rect[2]; | |
$imgH = $rect[3]; |
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 (expression) | |
{ | |
case label1: | |
statements1 | |
break; | |
case label2: | |
statements2 | |
break; | |
default: | |
statements_def |
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 type="text/javascript" src="https://getfirebug.com/firebug-lite-debug.js"></script> |
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
try | |
{ | |
} | |
catch (Exception $e) | |
{ | |
echo $e->getMessage(); | |
} |
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
Math.floor(Math.random()*1980).toString(); |
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> |