vagrant box add centos-6.3 https://s3.amazonaws.com/itmat-public/centos-6.3-chef-10.14.2.box
mkdir vagrant-lamp
vagrant init centos-6.3
require 'mail' | |
require 'csv' | |
FILE = ARGV[0] | |
Mail.defaults do | |
delivery_method :smtp, { | |
address: '', | |
port: 587, | |
domain: '', | |
user_name: '', |
#!/bin/bash | |
# vim: set sts=4 sw=4 et tw=0 : | |
# | |
# License: BSD | |
AUTOMAGIC_MODE="true" | |
OPACITY_100="0xffffffff" | |
OPACITY_0="0x0" | |
: ${XWININFO:=$(type -P xwininfo)} |
sudo apt-get update -y && apt-get upgrade -y | |
sudo apt-get install vim \ | |
git \ | |
tree \ | |
libldap2-dev \ | |
libldap-2.4-2 \ | |
libtool-bin \ | |
libzip-dev \ | |
lbzip2 \ |
#!/usr/bin/python | |
# -*- coding: utf-8 -*- | |
class SistemaDeArquivo: | |
def __init__(self, nome, tamanho = 0): | |
self.nome = nome | |
self.tamanho = tamanho | |
def get_nome(self): | |
return self.nome |
<?php | |
/** | |
* Conta a quantidade de letras de uma determinada palavra | |
* | |
* @param $palavra String Palavra a ser analisada pelo contador | |
* @param $letras Array|String Letras que deseja contar na palavra | |
* @throws InvalidArgumentException Lança exceção caso não passe pelo menos uma letra para contar na palavra | |
* @return Int Quantidade de ocorrências de $letras na $palavra | |
*/ | |
function contarLetras($palavra, $letras = ['a', 'e', 'i', 'o', 'u']) |
<?php | |
namespace Application\Controller; | |
use Zend\Mvc\Controller\AbstractActionController; | |
use Zend\View\Model\ViewModel; | |
class IndexController extends AbstractActionController | |
{ | |
public function indexAction() | |
{ |
<VirtualHost *:80> | |
ServerName application.local | |
DocumentRoot <application-path>/public | |
SetEnv APPLICATION_ENV development | |
<Directory <application-path>/public> | |
AllowOverride All | |
Require all granted | |
</Directory> | |
</VirtualHost> |
RewriteEngine On | |
# The following rule tells Apache that if the requested filename | |
# exists, simply serve it. | |
RewriteCond %{REQUEST_FILENAME} -s [OR] | |
RewriteCond %{REQUEST_FILENAME} -l [OR] | |
RewriteCond %{REQUEST_FILENAME} -d | |
RewriteRule ^.*$ - [NC,L] | |
# The following rewrites all other queries to index.php. The | |
# condition ensures that if you are using Apache aliases to do | |
# mass virtual hosting, the base path will be prepended to |
<?php | |
/** | |
* Restringe o acesso às páginas fora da white list. útil para controlar login. | |
* | |
* @param Zend\Mvc\MvcEvent $e Instância | |
* @param Mixed $authService Instância do serviço de autenticação | |
* @param Array $whiteListRoutes Lista de rotas na white list (Sem precisar de login) | |
* @param String $loginRoute Nome da rota para o login | |
* @link http://stackoverflow.com/questions/14137868/zend-framework-2-global-check-for-authentication-with-zfcuser |