Skip to content

Instantly share code, notes, and snippets.

<?php
class Iterable implements IteratorAggregate{
protected $array;
function __construct(array $array = null ){
if(is_array($array))
$this->setArray($array);
}
function getArray(){
@raphaeldealmeida
raphaeldealmeida / Date.php
Created February 25, 2012 06:38
Exemplo_phar
<?php
//colocar na pasta app
namespace MyApp;
class Date {
public static function next_week()
{
$datetime = new \DateTime();
$datetime->add(new \DateInterval('P7D'));
return $datetime->format('Y-m-d');
}
@raphaeldealmeida
raphaeldealmeida / base.pp
Created September 22, 2012 11:41
Arquivo de configuração Puppet
class base {
group { "puppet":
ensure => "present",
}
exec { "apt_update":
command => "apt-get update",
path => "/usr/bin"
}
raphael@curupira:~/Downloads/desenvolvimento/php-5.3.20$ make test TESTS=tests/output/bug63377.phpt
Build complete.
Don't forget to run 'make test'.
=====================================================================
PHP : /home/raphael/Downloads/desenvolvimento/php-5.3.20/sapi/cli/php
PHP_SAPI : cli
PHP_VERSION : 5.3.20
@raphaeldealmeida
raphaeldealmeida / Skeleton.php
Last active December 13, 2015 19:09
A improvement for ZFTool works with proxy
<?php
namespace ZFTool\Model;
use Zend\Code\Generator\ValueGenerator;
class Skeleton
{
const SKELETON_URL = 'https://github.com/zendframework/ZendSkeletonApplication/archive/master.zip';
const API_LAST_COMMIT = 'https://api.github.com/repos/zendframework/ZendSkeletonApplication/commits?per_page=1';
@raphaeldealmeida
raphaeldealmeida / gist:5037896
Created February 26, 2013 11:42
Erro vagrant-oracle-xe
raphael@SIGPES-RAPHAEL:~/Downloads/vagrant-oracle-xe$ vagrant up
[oraxe] VM already created. Booting if it's not already running...
[oraxe] Clearing any previously set forwarded ports...
[oraxe] Forwarding ports...
[oraxe] -- 22 => 41022 (adapter 1)
[oraxe] Creating shared folders metadata...
[oraxe] Clearing any previously set network interfaces...
[oraxe] Preparing network interfaces based on configuration...
[oraxe] Running any VM customizations...
[oraxe] Booting VM...
class oracle::server {
file {
"/etc/wgetrc":
source => "puppet:///modules/oracle/wgetrc";
}
file {
"/etc/apt/apt.conf.d/01proxy":
source => "puppet:///modules/oracle/01proxy";
Acquire::http::Proxy "http://ubuntu-galeao.ccarj.intraer:3142";
# You can set the default proxies for Wget to use for http, https, and ftp.
# They will override the value in the environment.
https_proxy = https://user:[email protected]:3128/
http_proxy = http://user:[email protected]:3128/
ftp_proxy = http://user:[email protected]:3128/
# If you do not want to use proxy at all, set this to off.
use_proxy = on
@raphaeldealmeida
raphaeldealmeida / gist:6855246
Last active December 24, 2015 20:08
Compilação do PHP
# pacotes .deb
#
# apache 2
# apache2 apache2-dev apache2-utils
#
# MySQL
# libmysqlclient-dev mysql-server-5.5
#
# ReadLine
# libreadline6-dev