Skip to content

Instantly share code, notes, and snippets.

@fiunchinho
fiunchinho / gist:19efa2a7729698d6d09a
Last active August 29, 2015 14:03
Deployment tools
* PHP-based:
** http://magephp.com/
** http://kohkimakimoto.github.io/altax/
** http://deployer.in/
** http://rocketeer.autopergamene.eu/
* Ruby
** http://capistranorb.com/
* Python
@fiunchinho
fiunchinho / .travis.yml
Created August 29, 2012 20:16 — forked from gyndav/.travis.yml
Simple Mongo PHP Driver extension installer for Travis CI. Works like a charm for other PECL extensions too.
before_script:
- ./path/to/mongo-php-driver-installer.sh
@fiunchinho
fiunchinho / mongod
Created June 2, 2013 22:08
Rotate mongo logs every week
# /etc/logrotate.d/mongod
# http://linuxcommand.org/man_pages/logrotate8.html
/var/log/mongodb/mongodb.log {
weekly
missingok
rotate 30
compress
dateext
notifempty
sharedscripts
# watch files and rerun phpunit on changes
phpunitwait() {
while inotifywait $(find $1 -name '*.php');
do
clear;
phpunit --colors $2;
done;
}
@fiunchinho
fiunchinho / tdd
Last active December 25, 2015 10:19
Watch for changes in files (code and tests) and run phpunit tests whenever changes are detected. Althought is not needed, I recommend to use a phpunit.xml configuration file.
#!/bin/bash
if [ $# -ne 1 ]; then
echo "Usage: $0 CODE-DIRECTORY"
exit 1
fi
code_directory=$1
if [ ! -d $code_directory ]; then
@fiunchinho
fiunchinho / UserSpec.php
Created December 2, 2013 20:09
Triying to describe in PHPSpec that using wrong parameters throws exception
<?php
namespace MyApp;
use PhpSpec\ObjectBehavior;
use Prophecy\Argument;
class UserSpec extends ObjectBehavior
{
function it_fails_when_using_a_not_valid_email()
@fiunchinho
fiunchinho / .vimrc
Created January 25, 2014 21:29
Current vim configuration file
" Theme
colorscheme railscasts
" Sugar
set showmatch " highlight matching [{()}]
set number " show line numbers
set showcmd " show command in bottom bar
set cursorline " highlight current line
syntax on " Enable syntax highlighting
@fiunchinho
fiunchinho / postgres-cheatsheet.md
Last active March 2, 2016 18:34 — forked from Kartones/postgres-cheatsheet.md
PostgreSQL command line cheatsheet

PSQL

Magic words:

psql -U postgres

If run with -E flag, it will describe the underlaying queries of the \ commands (cool for learning!).

Most \d commands support additional param of __schema__.name__ and accept wildcards like *.*

### Keybase proof
I hereby claim:
* I am fiunchinho on github.
* I am fiunchinho (https://keybase.io/fiunchinho) on keybase.
* I have a public key whose fingerprint is 7835 2286 73D6 3CA1 2FFE AC8A 8162 5EDD B10E 8F93
To claim this, I am signing this object:
@fiunchinho
fiunchinho / OneLiners.md
Last active May 5, 2016 09:43
One liners to fetch, uncompress and remove