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 | |
$content = http_build_query(array( | |
'cidade' => 'Rio de Janeiro', | |
'tipo' => 'Apartamento', | |
)); | |
$context = stream_context_create(array( | |
'http' => array( | |
'method' => 'POST', |
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 | |
/** | |
Validate an email address. | |
Provide email address (raw input) | |
Returns true if the email address has the email | |
address format and the domain exists. | |
*/ | |
function verificarEmail($email) | |
{ | |
$isValid = true; |
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 | |
$search = "http://search.twitter.com/search.atom?q=gasolina&rpp=50&geocode=-5.794478%2C-35.210953%2C100km"; | |
$tw = curl_init(); | |
curl_setopt($tw, CURLOPT_URL, $search); | |
curl_setopt($tw, CURLOPT_RETURNTRANSFER, TRUE); | |
$twi = curl_exec($tw); |
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 carro(params){ | |
this.velocidadeAtual = 0; | |
var velocidadeMax = 100; | |
this.acelerar = function(){ | |
if(this.velocidadeAtual < velocidadeMax){ | |
this.velocidadeAtual += 10; | |
alert('vroom'); | |
} | |
} |
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
@access - controle de acesso para um elemento. Se for definido como private o elemento não constará na documentação | |
@author - utilizado para indicar o autor de qualquer elemento que possa ser documentado (variáveis globais, funções, classes, métodos, etc.). Nesta tag pode-se adicionar o e-mail entre os sinais de < e > | |
@category - especifica a categoria para organizar os pacotes dos elementos documentados | |
@copyright - informações de copyright do elemento. | |
@deprecated - indica que o elemento está depreciado, sendo assim não deve ser utilizado por pode ser removido posteriormente | |
@example - inclui um arquivo externo de exemplo com sintaxe destacada | |
@final - indica que um método de uma classe nunca deve ser sobrescrito em uma classe filha | |
@filesource - cria a referência cruzada para o arquivo que contem o código fonte | |
@global - documenta uma variável global. Também é utilizado para métodos/funções | |
@ignore - previne o elemento de ser documentado, normalmente utilizado para elementos duplicados |
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 | |
header('Content-type: application/json'); | |
$cep = $_GET['cep']; | |
$curl = curl_init(); | |
curl_setopt_array($curl, array( | |
CURLOPT_URL => 'http://cep.republicavirtual.com.br/web_cep.php?formato=javascript&cep=' . $cep, | |
CURLOPT_HEADER => false, | |
CURLOPT_RETURNTRANSFER => true) |
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 | |
$imparPar = function($number) | |
{ | |
return $number & 1; | |
}; | |
echo $imparPar(2); | |
?> |
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 | |
Router::connect('/*', array('controller' => 'pages', 'action' => 'display')); | |
?> |
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
#Negar a acesso a tudo mundo e liberar para um ip | |
Order Deny,Allow | |
Deny from all | |
Allow from 192.168.1.103 | |
<IfModule mod_rewrite.c> | |
RewriteEngine on | |
#forçar o www | |
RewriteCond %{HTTP_HOST} !^www\. [NC] |
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 | |
$this->paginate = array('joins'=>$joins,'fields' => array('*'),'conditions'=> array ('Sale.agent'=>$user['User']['id'])); | |
?> |