Skip to content

Instantly share code, notes, and snippets.

@jtdp
jtdp / gist:9389912
Created March 6, 2014 13:39
Get all lines in file1 that do not appear in file2
grep -F -x -v -f file1 file2
@jtdp
jtdp / gist:9389903
Created March 6, 2014 13:38
Get text between quotes
sed 's/.*"\(.*\)"[^"]*$/\1/'
@jtdp
jtdp / gist:6054113
Created July 22, 2013 14:10
Find larges files in directory recursively
find . -type f -exec ls -s {} \; | sort -n -r | head -5
@jtdp
jtdp / gist:5747457
Created June 10, 2013 09:14
Delete local git branch
git branch -d branchname
@jtdp
jtdp / gist:5547427
Created May 9, 2013 13:27
mysqldump without locking tables
mysqldump --lock-tables=false
@jtdp
jtdp / gist:5452285
Created April 24, 2013 13:53
If you get the error: SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed while accessing... you need to set GIT_SSL_NO_VERIFY to true.
# On Centos..
EXPORT GIT_SSL_NO_VERIFY=true
@jtdp
jtdp / xdebug-snippets.js
Last active February 10, 2021 18:57
XDebug Snippets
// From http://www.jetbrains.com/phpstorm/marklets/
// Start XDebug Debug Session
javascript:(function(){document.cookie='XDEBUG_SESSION='+'PHPSTORM'+';path=/;';})()
// Stop XDebug Debug Session
javascript:(function(){document.cookie='XDEBUG_SESSION='+''+';expires=Mon, 05 Jul 2000 00:00:00 GMT;path=/;';})()
// Debug Current Page
javascript:(function(){document.cookie='XDEBUG_SESSION='+'PHPSTORM'+';path=/;';document.location.reload();document.cookie='XDEBUG_SESSION='+''+';expires=Mon, 05 Jul 2000 00:00:00 GMT;path=/;';})()
@jtdp
jtdp / gist:5451184
Created April 24, 2013 10:28
Set git username and email address
git config --global user.name "My Name"
git config --global user.email = "[email protected]"
@jtdp
jtdp / gist:5451177
Created April 24, 2013 10:26
Set proxy for git to use
git config --global http.proxy http://proxyhost.tld:port
@jtdp
jtdp / gist:5444884
Created April 23, 2013 15:59
Imported gzipped sql dump into mysql database
zcat database_name_file.sql.gz | mysql -uroot -p database_name