Skip to content

Instantly share code, notes, and snippets.

Working from home

Carlton carltondickson

Working from home
  • Carlton Dickson Development Ltd.
  • London
View GitHub Profile
carltondickson / gist:288772c69ce479d99673
Created July 1, 2014 14:27
Creates SQL that retrieves all tables and row counts for a given schema
View gist:288772c69ce479d99673
'" AS table_name, COUNT(*) AS exact_row_count FROM ',
cd ~/Downloads
# IE8 - Windows XP
wget -i
# IE8 - Windows 7
wget -i
# Give execute permissions
chmod +x ./IE8*.sfx
carltondickson / gist:bddf76faf86370f17d14
Created August 11, 2014 16:41
Show contents of a git stash
View gist:bddf76faf86370f17d14
git stash show -p stash@{0}
carltondickson / gist:6180f965ad22474cf1a9
Last active August 29, 2015 14:05
Mysql - Character and collation settings
View gist:6180f965ad22474cf1a9
# Defaults, log in to command line and run these...clients like SQLYog may have already SET NAME utf8 so results would not necessarily show the defaults
SHOW VARIABLES LIKE "collation_database";
| Variable_name | Value |
| collation_database | latin1_swedish_ci |
SHOW VARIABLES LIKE "%character%";
carltondickson / gist:f53c9e675a3d3e35366e
Created August 13, 2014 16:24
MySQL select certain data into data dump
View gist:f53c9e675a3d3e35366e
# 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'
carltondickson / gist:04a296dfccf7a2207447
Last active August 29, 2015 14:05
scp - copy from remote to local
View gist:04a296dfccf7a2207447
# Auto-complete works if you have ssh keys set up to the server
scp user@homeip:/path/to/file /local/path/
# Credit
carltondickson / gist:d62a01a1e45822cfa0ea
Last active August 29, 2015 14:07
Profiling options for PHPStorm configuration
View gist:d62a01a1e45822cfa0ea
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
carltondickson / gist:53c362475eba16ae4227
Created November 13, 2014 11:39
Reduce compiz memory usage Ubuntu
View gist:53c362475eba16ae4227
# From
# 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
carltondickson / gist:27fc62d1725ec373678c
Created January 2, 2015 09:53
Get and track a new remote branch
View gist:27fc62d1725ec373678c
git fetch
git branch --track branch-name origin/branch-name
# From
carltondickson / gist:1716a457a11fa5158860
Last active August 29, 2015 14:13
GIt prompt messages
View gist:1716a457a11fa5158860
# in-prompt git branch indicator
parse_git_branch() {
# ref
# ref
# ref
#also see
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)$ "