Skip to content

Instantly share code, notes, and snippets.

@isidromerayo
isidromerayo / ExceptionsTest.php
Created February 6, 2012 18:30
Mockery examples
<?php
/**
* @expectedException OutOfBoundsException
*/
public function testThrowsException()
{
$mock = m::mock('MyMockedClass');
$mock->shouldReceive('foo')->andThrow(new OutOfBoundsException);
$mock->foo();
#!/bin/sh
curl -s https://getcomposer.org/installer | php
php composer.phar create-project isidromerayo/simple_php_skeleton --dev
cd simple_php_skeleton
bin/phpunit
@isidromerayo
isidromerayo / gist:3691718
Created September 10, 2012 15:56
problems to create-project with Symfony2.x without version
$ composer.phar create-project symfony/framework-standard-edition demo_sf2.x
Installing symfony/framework-standard-edition (dev-master 506ffaab8d8474db2512fca879ca4b9877616a1e)
- Installing symfony/framework-standard-edition (dev-master master)
Cloning master
Created project in demo_sf2.x
Loading composer repositories with package information
Installing dependencies from lock file
Your lock file is out of sync with your composer.json, run "composer.phar update" to update dependencies
Your requirements could not be resolved to an installable set of packages.
@isidromerayo
isidromerayo / gist:3693366
Created September 10, 2012 19:48
ejemplos de .htaccess
http://www.catswhocode.com/blog/10-useful-htaccess-snippets-to-have-in-your-toolbox
@isidromerayo
isidromerayo / gist:3772431
Created September 23, 2012 17:35
permisos para proyecto web
find /var/www/html -type d -exec chmod -R 775 {} \;
find /var/www/html -type f -exec chmod -R 664 {} \;
@isidromerayo
isidromerayo / gist:3781107
Created September 25, 2012 10:35
ls -la releases
~/my_app_deploy]$ ls -al releases/20120925094501/
total 0
?--------- ? ? ? ? ? .
?--------- ? ? ? ? ? ..
?--------- ? ? ? ? ? .buildpath
?--------- ? ? ? ? ? build.xml
?--------- ? ? ? ? ? Capfile
?--------- ? ? ? ? ? composer.json
?--------- ? ? ? ? ? composer.lock
?--------- ? ? ? ? ? config
@isidromerayo
isidromerayo / testing.yml
Created September 25, 2012 10:38
mage enviroment testing
#testing
deployment:
user: my_user
from: ./
to: /var/www/my_user/my_app_deploy
excludes:
- build
- tests
releases:
enabled: true
@isidromerayo
isidromerayo / gist:3786949
Created September 26, 2012 09:13
Permisos en Symfony
sudo setfacl -R -m u:www-data:rwx -m u:`whoami`:rwx app/cache app/logs
sudo setfacl -dR -m u:www-data:rwx -m u:`whoami`:rwx app/cache app/logs
@isidromerayo
isidromerayo / all-in-one-symfony2-jobeet.sh
Created September 28, 2012 16:45
symfony2-jobeet (sf2.1.x)
#!/bin/sh
curl -s https://getcomposer.org/installer | php
php composer.phar create-project isidromerayo/symfony2-jobeet
cd symfony2-jobeet
@isidromerayo
isidromerayo / backup_mysql_per_table.sh
Created October 1, 2012 12:57
backup mysql file per table
#!/bin/bash
# comands
ECHO=/bin/echo
DATE=/bin/date
DF=/bin/df
EXPORT=/usr/bin/mysqldump
#validate number params