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 | |
App::uses('AppController', 'Controller'); | |
class UsuariosController extends AppController { | |
public $paginate = array( | |
'limit' => 25 | |
); | |
public function index() { |
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 | |
/** | |
* | |
*/ | |
class Post extends AppModel | |
{ | |
public $validate = array( | |
'title' => array( | |
'rule' => 'notEmpty' |
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 | |
// find no model Banco com relacionamento | |
array( | |
array( | |
'Banco' => array( | |
'nome' => 'teste', | |
'id' => 1 | |
), | |
'PlanosDeConta' => array( |
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 | |
App::uses('AppModel', 'Model'); | |
/** | |
* User Model | |
* | |
* @property Company $Company | |
*/ | |
class User extends AppModel { | |
/** |
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
#!/usr/bin/env bash | |
echo ">>> Starting Install Script" | |
# Update | |
sudo apt-get update | |
# Install MySQL without prompt | |
sudo debconf-set-selections <<< 'mysql-server mysql-server/root_password password root' | |
sudo debconf-set-selections <<< 'mysql-server mysql-server/root_password_again password root' |
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
set nocompatible | |
filetype off | |
" set the runtime path to include Vundle and initialize | |
set rtp+=~/.vim/bundle/Vundle.vim | |
call vundle#rc() | |
" let Vundle manage Vundle, required | |
Bundle "gmarik/Vundle.vim" | |
Bundle "scrooloose/nerdtree" |
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
import java.util.ArrayList; | |
import java.util.Collection; | |
public class Main { | |
public static void main(String[] args) { | |
Collection<String> nomes = new ArrayList<String>(); | |
nomes.add("Primeiro nome digitado"); | |
nomes.add("Segundo nome"); |
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
# ... | |
# put the google sdk on your path | |
export GAE_PATH="/home/your-username/Programs/google_appengine" | |
# add the GAE_PATH to your current $PATH | |
export PATH=$PATH:$GAE_PATH | |
# to run the local environment | |
# $ dev_appserver.py --php_executable_path=/usr/bin/php5-cgi ./ |
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 | |
interface GroupRepository | |
{ | |
public function createNewGroup($name, $type, User $user); | |
} | |
class EloquentGroupRepository implements GroupRepository | |
{ | |
public function createNewGroup($name, $type, User $user) |
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 | |
use Acme\Repositories\TaskRepository; | |
use Acme\Repositories\UserRepository; | |
use Acme\Mailers\UserMailer; | |
class TasksController extends Controller | |
{ | |
/** | |
* @var Acme\Repositories\TaskRepository |