Skip to content

Instantly share code, notes, and snippets.

@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 = "me@myemailhost.tld"
@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 / gist:5547427
Created May 9, 2013 13:27
mysqldump without locking tables
mysqldump --lock-tables=false
@jtdp
jtdp / gist:5747457
Created June 10, 2013 09:14
Delete local git branch
git branch -d branchname
@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 / 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:5443498
Last active January 24, 2024 08:59
Revert file permission changes in local git repository.. Very useful when you change permissions due to working on a samba share. Lifted from: http://stackoverflow.com/questions/2517339/git-how-to-recover-the-file-permissions-git-thinks-the-file-should-be
git diff -p \
| grep -E '^(diff|old mode|new mode)' \
| sed -e 's/^old/NEW/;s/^new/old/;s/^NEW/new/' \
| git apply
@jtdp
jtdp / gist:5443297
Last active March 13, 2024 12:58
See changes before pulling from remote git repository
# fetch the changes from the remote
git fetch origin
# show commit logs of changes
git log master..origin/master
# show diffs of changes
git diff master..origin/master
# apply the changes by merge..