Skip to content

Instantly share code, notes, and snippets.

View vitorpacheco's full-sized avatar

Vitor Pacheco vitorpacheco

  • Solutis Tecnologias
  • Brasil, Salvador - BA
View GitHub Profile
@vitorpacheco
vitorpacheco / appendices.rst
Created March 5, 2012 15:01
CakePHP Docs Appendices PT

Apêndices

Os apêndices contêm informações sobre os novos recursos introduzidos na versão 2.0 e o guia de migração da versão 1.3 para a versão 2.0.

Guia de Migração para a Versão 2.0

.. toctree::
@vitorpacheco
vitorpacheco / 2-1-migration-guide.rst
Created March 5, 2012 15:38
CakePHP Docs Appendices PT

Guia de Migração para a Versão 2.1

O CakePHP 2.1 é um atualização totalmente compatível com API do 2.0. Esta página apresenta as mudanças e melhorias feitas no 2.1.

AppController, AppHelper, AppModel and AppShell

Como essas classes foram removidas do núcleo do CakePHP, agora elas são obrigatórias em sua aplicação. Se você não tiver essas classes, você pode usar o seguinte durante a atualização:

@vitorpacheco
vitorpacheco / build.xml
Created March 30, 2012 18:10
Jenkins + CakePHP
<?xml version="1.0" encoding="UTF-8"?>
<project name="name-of-project" default="build">
<target name="build"
depends="prepare,lint,phploc,pdepend,phpmd-ci,phpcs-ci,phpcpd,phpdoc,phpcb"/>
<target name="build-parallel"
depends="prepare,lint,tools-parallel,phpcb"/>
<target name="tools-parallel"
@vitorpacheco
vitorpacheco / config.xml
Created April 3, 2012 02:14
Jenkins Project config file for Croogo
<?xml version='1.0' encoding='UTF-8'?>
<project>
<actions/>
<description>&lt;embed height=&quot;300&quot; src=&quot;ws/build/pdepend/overview-pyramid.svg&quot; type=&quot;image/svg+xml&quot; width=&quot;500&quot;&gt;&lt;/embed&gt;&#xd;
&lt;embed height=&quot;300&quot; src=&quot;ws/build/pdepend/dependencies.svg&quot; type=&quot;image/svg+xml&quot; width=&quot;500&quot;&gt;&lt;/embed&gt;</description>
<keepDependencies>false</keepDependencies>
<properties>
<hudson.plugins.googlecode.GoogleCodeProjectProperty/>
<com.coravy.hudson.plugins.github.GithubProjectProperty>
<projectUrl>http://github.com/croogo/croogo/</projectUrl>
@vitorpacheco
vitorpacheco / comment.rb
Created April 14, 2012 02:19
Getting Started with Rails
class Comment < ActiveRecord::Base
belongs_to :post
attr_accessible :body, :commenter
end
@vitorpacheco
vitorpacheco / pagination.ctp
Created April 22, 2012 14:46 — forked from slywalker/pagination.ctp
pagination element for CakePHP on twitter bootstrap
<?php
if (!isset($modules)) {
$modulus = 11;
}
if (!isset($model)) {
$models = ClassRegistry::keys();
$model = Inflector::camelize(current($models));
}
?>
<div class="pagination">
@vitorpacheco
vitorpacheco / addItems.js
Created April 25, 2012 00:52
jQuery Plugins
$.fn.addItems = function(data) {
return this.each(function() {
var list = $(this)
list.empty()
if (data.length != []) {
$.each(data, function(index, text) {
list.append("<option value="+index+">"+text+"</option>")
})
} else {
list.append("<option>Nenhuma opção encontrada</option>")
@vitorpacheco
vitorpacheco / Grupo.php
Created May 4, 2012 02:46
beforeDelete
public function beforeDelete($cascade = true) {
if (in_array($this->id, array(self::GRUPO_ADMIN, self::GRUPO_PUBLICO))) {
return false;
}
return true;
}
<?php
class AppModel extends Model {
public function getQuery($type, $options = array()) {
$dbo = $this->getDataSource();
$defaults = array(
'fields' => array('`' . $this->alias . '`.`*`'),
'table' => '"' . $dbo->config['schema'] . '".' . $dbo->fullTableName($this),
'alias' => $this->alias,
'limit' => null,
\usepackage{array}
\usepackage{tabularx}
\usepackage[num,abnt-full-initials=yes]{abntcite}
\usepackage{times,fancyhdr}
\usepackage{graphicx,url}
\usepackage{epsfig}
\usepackage{amssymb}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amsthm,amscd}