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
- name: PHP | Create the webgrind dirs | |
file: name=/var/www/webgrind/storage state=directory owner=www-data mode=0700 | |
- name: PHP | Download webgrind package | |
get_url: url=https://github.com/bionoren/webgrind/archive/xdebug23.zip dest=/tmp/webgrind.tar.gz | |
- name: PHP | Extract the webgrind package | |
unarchive: src=/tmp/webgrind.tar.gz dest=/var/www/webgrind copy=no creates=/var/www/webgrind/index.php | |
- name: PHP | Move the webgrind package contents to the webgrind dir |
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
export PS1='$(printf '%.0s-' $(seq 1 $COLUMNS))\n\[\e[0;32m\]\u@\h:\[\e[m\]\[\e[36;40m\]\w\[\e[m\]\[\e[1;32m\]\$\[\e[m\] ' |
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
{ | |
_index:"index", | |
_type:"filme", | |
_id:"16855", | |
_version:1, | |
exists:true, | |
_source:{ | |
titulo_portugues:"RIO", | |
titulo_original:"Rio", | |
ano:"2011", |
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 class EnumExample { | |
public static void main(String []args){ | |
testGender(Gender.FEMALE); | |
testGender(Gender.MALE); | |
} | |
public static void testGender(Gender gender) { | |
switch(gender) { | |
case FEMALE: | |
System.out.println("Female"); |
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
<div id="login-box"> | |
<div class="form"> | |
<?php $form=$this->beginWidget('CActiveForm', array( | |
'id'=>'login-form', | |
)); ?> | |
<?php echo $form->errorSummary($model); ?> | |
<div class="row"> | |
<?php echo $form->labelEx($model,'username'); ?> | |
<?php echo $form->textField($model,'username'); ?> | |
<?php echo $form->error($model,'username'); ?> |
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
<?php | |
class AdminLoginForm extends CFormModel | |
{ | |
public $username; | |
public $password; | |
public $rememberMe; | |
private $_identity; |
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 beforeControllerAction($controller, $action) | |
{ | |
if(parent::beforeControllerAction($controller, $action)) | |
{ | |
if($this->user->isGuest && !($controller->id == 'default' && $action->id == 'login')) { | |
$this->user->loginRequired(); | |
} | |
return true; | |
} | |
else |
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
<?php | |
class DefaultController extends CController | |
{ | |
public $defaultAction = 'login'; | |
public function actionLogin() { | |
$this->layout = 'login'; | |
$model = new AdminLoginForm; | |
if(isset($_POST['AdminLoginForm'])) { |
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
<?php $this->widget('zii.widgets.grid.CGridView', array( | |
'columns'=>array( | |
array( | |
'name' => 'pesquisa', | |
'value' => '$data->pesquisa', | |
'header' => 'Termo', | |
), | |
array( | |
'name' => 'data_cadastro', | |
'value' => 'Yii::app()->dateFormatter->formatDatetime(strtotime($data->data_cadastro), "short", "short")', |
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
<?php | |
class Os extends CActiveRecord { | |
public function relations() { | |
return array( | |
'cliente' => array(self::BELONGS_TO, 'Cliente', 'id_cliente'), | |
); | |
} | |
} |