Skip to content

Instantly share code, notes, and snippets.

View pablofmorales-olx's full-sized avatar

Pablo Morales pablofmorales-olx

View GitHub Profile
<?php
class HttpRequest
{
private $_httpRequest;
public function __construct($httpRequest)
{
$this->_httpRequest = $httpRequest;
}
@pablofmorales-olx
pablofmorales-olx / SomeTest.php
Created January 24, 2013 17:55
How to test private properties.
public function test_setResource()
{
$connection = new \Connection();
$originalName = 'ThisIsMyResource';
$connection->setResource($originalName);
$reflection = new \ReflectionClass('Connection');
$propertyRef = $reflection->getProperty('_resource');
$propertyRef->setAccessible(TRUE);
$resourceName = $propertyRef->getValue($connection);
$this->assertEquals($originalName, $resourceName);
#!/bin/sh
echo "Changing the DNS to " $1
if [ "$1" == 'local' ]; then
DNS='10.0.0.203'
elif [ "$1" == 'prod' ]; then
DNS='10.0.0.200'
elif [ "$1" == 'qa2' ]; then
DNS='10.0.0.202'
elif [ "$1" == 'qa1' ]; then
d='dirs -v | head -10'
egrep='egrep --color=auto'
fgrep='fgrep --color=auto'
g=git
ga='git add'
gb='git branch'
gba='git branch -a'
gc='git commit -v'
gca='git commit -v -a'
gcl='git config --list'
@pablofmorales-olx
pablofmorales-olx / composer.json
Created January 10, 2013 14:18
composer.json for twig checkout project
{
"require": {
"silex/silex": "1.0.*",
"twig/twig": ">=1.8,<2.0-dev",
"symfony/twig-bridge": "2.1.*"
},
"minimum-stability": "dev"
}
@pablofmorales-olx
pablofmorales-olx / .vimrc
Created January 10, 2013 13:25
Config for vim
set nu " Line numbers on
set nowrap " Line wrapping off
set timeoutlen=250 " Time to wait after ESC (default causes an annoying delay)
set ts=4 " Tabs are 2 spaces
set bs=2 " Backspace over everything in insert mode
set shiftwidth=4 " Tabs under smart indent
set nocp incsearch
set cinoptions=:0,p0,t0
set cinwords=if,else,while,do,for,switch,case
set formatoptions=tcqr
Vagrant::Config.run do |config|
#config.vm.boot_mode = :gui
config.vm.box = "lucid32"
config.vm.share_folder "sites", "/home/httpd", "/Users/pablo/Sites", :extra => 'dmode=775,fmode=775'
#config.vm.network :bridged, :bridge => "en0: Ethernet"
config.vm.network :hostonly, "192.168.5.10"
end