Skip to content

Instantly share code, notes, and snippets.

View donvitonet's full-sized avatar

Reginaldo Lima donvitonet

  • Belo Horizonte
View GitHub Profile
{
"workbench.colorTheme": "Dracula",
"editor.fontSize": 18,
"editor.lineHeight": 24,
"editor.fontFamily": "'Fira Code', 'Droid Sans Mono', 'monospace', monospace, 'Droid Sans Fallback'",
"editor.fontLigatures": true,
"editor.rulers": [
80,
120
],
# ps -ef - disaply all processes
# grep apache2 - find the rows with apache
# grep -v grep - remove rows with the word grep
# awk '{print $2}' - get the second column of the previous output
# kill -9 $(..) - execute kill -9 on all the values returned from the previous pipes
kill -9 $(ps -ef |grep apache2 |grep -v grep| awk '{print $2}')
- Criando uma instância AWS EC2
- Sistema Operacional Amazon Linux AMI 2012.09.01 64bit
- Tipo t1.micro
- Zona : sa-east-1a
- Tags
- Name : seuNomeInstalacao
- Grupo de Segurança : seuGrupoSeguranca
- Portas abertas : 22(SSH), 80(HTTP), 3306(MYSQL)
- Chave de acesso :
E:\Reginaldo\Programas\suaChave.pem
public $components = array(
'Session'
,'Mensagem'
,'Auth' => array(
'loginAction' => array(
'controller' => 'usuarios'
,'action' => 'login'
)
,'loginRedirect' => array(
'controller' => 'usuarios'
server {
listen 80;
server_name webcal.engecal.teste www.webcal.engecal.teste;
access_log off;
error_log /var/log/nginx/webcal.log;
root /var/opt/app/current;
index index.php;
public function shutdown( \Controller $controller ) {
if ( $this->_init ) {
$this->Pdf->WriteHTML( $controller->response->body() , 2 );
$this->Pdf->Output( $this->_filename, $this->_output );
exit();
}
$( '#MarcarTodos' ).live('click', function(){
var tabela = $( this ).parent().parent().parent().parent();
if ( this.checked === true ) {
tabela.find( ':checkbox' ).attr( 'checked', true );
} else {
tabela.find( ':checkbox' ).attr( 'checked', false );
$dataSource = $this->getDataSource();
$dataSource->begin();
try {
$dataSource->commit();
} catch( Exception $e ) {
$dataSource->rollback();
<?php
class FiltroUsuarioBehavior extends ModelBehavior {
public function beforeFind(\Model $model, $queryData){
if(AuthComponent::user("group_id") == 2){
$queryData["conditions"] = array("User.id" => AuthComponent::user("id"));
}
jQuery.datepicker.regional['pt-BR'] = {
closeText: 'Fechar',
prevText: '&#x3c;Anterior',
nextText: 'Pr&oacute;ximo&#x3e;',
currentText: 'Hoje',
monthNames: ['Janeiro','Fevereiro','Mar&ccedil;o','Abril','Maio','Junho',
'Julho','Agosto','Setembro','Outubro','Novembro','Dezembro'],
monthNamesShort: ['Jan','Fev','Mar','Abr','Mai','Jun',
'Jul','Ago','Set','Out','Nov','Dez'],
dayNames: ['Domingo','Segunda-feira','Ter&ccedil;a-feira','Quarta-feira','Quinta-feira','Sexta-feira','S&aacute;bado'],