This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** @var \Doctrine\DBAL\Connection $connection */ | |
$config = $connection->getConfiguration(); | |
// for excluding an specific table | |
$config->setFilterSchemaAssetsExpression('/^(?!table_name_to_exclude).*$/'); | |
When we try to generate Entities from database, with: | |
$config->setFilterSchemaAssetsExpression('/^(recipes|ingredients).*$/'); | |
# Source: https://coderwall.com/p/jofhdw/doctrine-tell-which-tables-to-work-with |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Head request and show headers only | |
curl -I www.acooke.org | |
curl --head www.acooke.org |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# https://stackoverflow.com/questions/3338126/git-how-to-diff-the-same-file-between-two-different-commits-on-the-same-branch/3338145#3338145 | |
git diff old_commit_id..now_commit_id file.php |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# in-prompt git branch indicator | |
parse_git_branch() { | |
# ref http://pastie.textmate.org/170118 | |
# ref http://www.bramschoenmakers.nl/en/node/511 | |
# ref http://tldp.org/HOWTO/Bash-Prompt-HOWTO/x329.html | |
#also see http://henrik.nyh.se/2008/12/git-dirty-prompt | |
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/\1/' -e 's/\(............\)..*/\1…/' -e 's/\(..*\)/[\1]/' -e 's/^\[master\]$/\x1b[41m&\x1b[0m/' -e 's/^\[test\]$/\x1b[45m&\x1b[0m/' -e 's/^\[demo\]$/\x1b[44m&\x1b[0m/' | |
} | |
PS1="\w \$(parse_git_branch)$ " |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git fetch | |
git branch --track branch-name origin/branch-name | |
# From http://stackoverflow.com/a/11262780/682754 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# From http://askubuntu.com/questions/82684/lowering-compiz-memory-usage#answer-82698 | |
# Kill compiz completely, including all child processes, freeing it's memory: | |
killall -9 compiz & | |
# Run unity and give you back a free terminal. | |
unity & disown |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Create new run configuration with following "Command Line > Interpreter Options" or add the options after "php" on the command line | |
/usr/bin/php -d xdebug.profiler_output_dir="/tmp/profiler" -d xdebug.profiler_enable_trigger=1 -d xdebug.profiler_enable=1 | |
Ref: http://confluence.jetbrains.com/display/PhpStorm/Profiling%20PHP%20applications%20with%20PhpStorm%20and%20Xdebug |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Show running queries | |
SHOW FULL PROCESSLIST; | |
# Show who is connected | |
SHOW STATUS LIKE '%onn%'; | |
# Search stored procedures for a string | |
SELECT * FROM information_schema.`ROUTINES` r WHERE r.`ROUTINE_DEFINITION` LIKE '%string%'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Auto-complete works if you have ssh keys set up to the server | |
scp user@homeip:/path/to/file /local/path/ | |
# Credit http://superuser.com/questions/337776/how-do-i-scp-from-remote-machine-to-local-machine-when-i-am-outside-of-my-home-n |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Following needs the file permission, double check you look on the DB server to find the outfile! | |
SELECT .. INTO OUTFILE '/home/foo/myfile.csv' | |
# If no file permission try command line instead | |
mysql -e "SELECT * FROM foo ORDER BY bar" > '/path/to/file' |