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
#config rvm | |
[[ -s "/home/wescley/.rvm/scripts/rvm" ]] && source "/home/wescley/.rvm/scripts/rvm" | |
#config path java | |
export JAVA_HOME=/usr/lib/jvm/java-6-sun | |
export PATH=/usr/lib/jvm/java-6-sun/bin:$PATH | |
#config path grails | |
export PATH=~/.grails/bin:$PATH | |
export GRAILS_HOME=~/.grails |
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(){ | |
$("#UsuarioLogin").blur(function(){ | |
$.ajax({ | |
type: "GET", | |
url: "valido/" + $(this).val(), | |
dataType: "json", | |
beforeSend: function(){ | |
console.log("carregando..."); | |
}, | |
success: function(text){ |
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 | |
function pegatwitter($usuario, $qtd = 10){ | |
$curl = curl_init(); | |
curl_setopt_array($curl, array( | |
CURLOPT_URL => 'http://twitter.com/statuses/user_timeline/' . $usuario . '.json?count=' . $qtd, | |
CURLOPT_HEADER => false, | |
CURLOPT_RETURNTRANSFER => true) | |
); | |
$request = curl_exec($curl); | |
curl_close($curl); |
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 | |
// Seu usuário do YouTube | |
$usuario = 'username'; | |
// URL do Feed RSS de vídeos de um usuário | |
$youTube_UserFeedURL = 'http://gdata.youtube.com/feeds/api/users/%s/uploads'; | |
// Usa cURL para pegar o XML do feed | |
$cURL = curl_init(sprintf($youTube_UserFeedURL, $usuario)); | |
curl_setopt($cURL, 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
-- | |
-- Estrutura da tabela `cars` | |
-- | |
CREATE TABLE IF NOT EXISTS `cars` ( | |
`id` int(11) NOT NULL AUTO_INCREMENT, | |
`kind_id` int(11) NOT NULL, | |
`album_id` int(11) DEFAULT NULL, | |
`type` set('novo','usado') DEFAULT NULL, | |
`year` varchar(45) DEFAULT NULL, |
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 admin_busca(){ | |
$this->layout = "ajax"; | |
$list = $this->Car->find('list',array('fields' => array('Car.id', 'Car.type'))); | |
foreach($list as $key => $value){ | |
$array[] = array("label" => $value, "value" => $value, "id" => $key); | |
} | |
echo json_encode($array); | |
} | |
======================================== | |
<div class="ui-widget"> |
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'])); | |
?> |
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 | |
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
<?php | |
$imparPar = function($number) | |
{ | |
return $number & 1; | |
}; | |
echo $imparPar(2); | |
?> |
OlderNewer