Skip to content

Instantly share code, notes, and snippets.

@juizmill
juizmill / User.php
Created April 17, 2015 11:38
HitCursos\V1\Entity\User
<?php
namespace HitCursos\V1\Entity;
use HitCursos\V1\Entity\Traits\OAuth;
use HitBase\Entity\AbstractEntity;
use Doctrine\ORM\Mapping as ORM;
use Zend\Stdlib\Hydrator\Reflection;
/**
@juizmill
juizmill / module.php
Created February 5, 2015 12:43
exemplo de tradução
public function onBootstrap(EventInterface $e)
{
$e->getApplication()->getServiceManager()->get('translator');
$eventManager = $e->getApplication()->getEventManager();
$moduleRouteListener = new ModuleRouteListener();
$moduleRouteListener->attach($eventManager);
//Parte que faz as traduções
$translator = $e->getApplication()->getServiceManager()->get('translator');
$translator->addTranslationFile(
@juizmill
juizmill / bootstrap.sh
Created January 19, 2015 19:26
bootstrap.sh - drupal-debian6
#!/usr/bin/env bash
# Atualiza lista de pacotes
sudo apt-get update
# instala o suporte a NFS (sem ele o Vagrant fica uma carroça)
# Notas:
# - para usarmos Vagrant com NFS é necessário que tanto host quanto guest tenham suporte instalado.
# - no host, rode: sudo apt-get install nfs-common nfs-kernel-server portmap (note o nfs-common nfs-kernel-server que o guest não tem)
# - embora tenha colocado o pacote 'portmap', o apt-get instalou o pacote 'rpcbind' em seu lugar.
@juizmill
juizmill / Vagrantfile
Created January 19, 2015 19:25
Vagrantfile - drupal-debian6
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = "drupal-debian6"
config.vm.provision :shell, :path => "bootstrap.sh"
config.vm.network :forwarded_port, host: 3307, guest: 3306
config.vm.network :forwarded_port, host: 27018, guest: 27017
@juizmill
juizmill / Vagrantfile
Created December 27, 2014 17:25
Vagrantfile
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = "hashicorp/precise64"
config.vm.provision :shell, :path => "bootstrap.sh"
config.vm.network :forwarded_port, host: 8080, guest: 80
@juizmill
juizmill / bootstrap.sh
Created December 27, 2014 17:24
Configuração da maquina virtual
#!/usr/bin/env bash
#Variáveis de configuração do projeto
ProjectName="cms"
PathPublic="public"
sudo apt-get update
sudo apt-get install -y python-software-properties
#Pacote PHP 5.5 ou 5.4
@juizmill
juizmill / module.config.php
Created December 27, 2014 17:15
Paginação na index e qualquer outra pagina no ZF2
<?php
namespace Cliente;
return array(
'router' => array(
'routes' => array(
'cliente' => array(
'type' => 'Literal',
'options' => array(
'route' => '/cliente',
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
# All Vagrant configuration is done here. The most common configuration
# options are documented and commented below. For a complete reference,
# please see the online documentation at vagrantup.com.
@juizmill
juizmill / rotas.php
Created December 12, 2014 20:00
Arquivo rotas.php
<?php
return [
'contato' => 'pages/contato.php',
'home' => 'pages/home.php',
'empresa' => 'pages/empresa.php',
'produtos' => 'pages/produtos.php',
'servicos' => 'pages/servicos.php',
];
@juizmill
juizmill / gist:96a0da9634b0a1bbcf51
Created December 12, 2014 19:48
Arquivo index.php
<?php require_once('config/config.php');?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="">
<meta name="author" content="">
<link rel="icon" href="../../favicon.ico">