Skip to content

Instantly share code, notes, and snippets.

@jtdp
jtdp / gist:9389903
Created March 6, 2014 13:38
Get text between quotes
sed 's/.*"\(.*\)"[^"]*$/\1/'
@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:4086339
Created November 16, 2012 10:44
Add unversioned resources to svn
svn status | grep "?" | awk '{print $2}' | xargs svn add
@jtdp
jtdp / gist:5443429
Created April 23, 2013 13:09
Cloning a git repository with submodules
# clone the repository
git clone <remote-url>
# cd into the directory created
cd <dir>
# init submodules
git submodule init
# update submodules - this is where the code is pulled in
@jtdp
jtdp / gist:5443290
Created April 23, 2013 12:49
Change remote url of git repository
git remote set-url origin <remote-url>
@jtdp
jtdp / gist:5443305
Last active December 16, 2015 13:39
Git remove file but keep local copy. Note that when other repository clones pull from the same remote, their local copy of the file will be deleted unless they have modified it.
git rm --cached <filename>
@jtdp
jtdp / gist:5443442
Created April 23, 2013 13:12
Adding a submodule in git
git submodule add <remote-url> <directory>
@jtdp
jtdp / gist:5444879
Created April 23, 2013 15:58
Dump mysql database to gzipped file
mysqldump -uroot -p database_name | gzip > database_name_file.sql.gz
@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
@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