Skip to content

Instantly share code, notes, and snippets.

Avatar

Andrew Hayes AndrewRussellHayes

View GitHub Profile
@AndrewRussellHayes
AndrewRussellHayes / git_X_on_all_subdirs.sh
Created Jan 11, 2015
Git command supplied will be performed against all subdirectories that are themselves git repositories
View update_git_repos.sh
#!/bin/bash
# store the current dir
CUR_DIR=$(pwd)
# Let the person running the script know what's going on.
echo "\n\033[1mPulling in latest changes for all repositories...\033[0m\n"
# Find all git repositories and update it to the master latest revision
for i in $(find . -name ".git" | cut -c 3-); do
View status_git_repos.sh
#!/bin/bash
# store the current dir
CUR_DIR=$(pwd)
# Let the person running the script know what's going on.
echo "\n\033[1mPulling in latest changes for all repositories...\033[0m\n"
# Find all git repositories and update it to the master latest revision
for i in $(find . -name ".git" | cut -c 3-); do
@AndrewRussellHayes
AndrewRussellHayes / allDos2unix
Created Jan 8, 2015
convert all files in dir from dos to unix
View allDos2unix
for file in `find /dirpath/* -type f`; do dos2unix $file $file; done
View uninstall_homebrew.sh
#!/bin/sh
# Just copy and paste the lines below (all at once, it won't work line by line!)
# MAKE SURE YOU ARE HAPPY WITH WHAT IT DOES FIRST! THERE IS NO WARRANTY!
function abort {
echo "$1"
exit 1
}
set -e
@AndrewRussellHayes
AndrewRussellHayes / mount-run_dropbox
Last active Aug 29, 2015
dropbox container run cmd
View mount-run_dropbox
docker run -t -i -v /HayesCloud/dockerhost/:/dockerhost dropbox
docker run -t -i -v /Users/andrew/tmp/HayesCloud/dockerhost/:/dockerhost dropbox
docker run -t -i -v /Users/andrew/tmpdrp/Dropbox/:/home/Dropbox dropbox
docker build -t dropbox .
View keybase.md

Keybase proof

I hereby claim:

  • I am andrewrussellhayes on github.
  • I am andrewhayes (https://keybase.io/andrewhayes) on keybase.
  • I have a public key whose fingerprint is 0C5B 4F11 699B A97A 7319 3EBF 3A49 4D3D 0618 274D

To claim this, I am signing this object:

View gist:d6f9c321f94692356f75
# There was a day where I have too many color schemes in iTerm2 and I want to remove them all.
# iTerm2 doesn't have "bulk remove" and it was literally painful to delete them one-by-one.
# iTerm2 save it's preference in ~/Library/Preferences/com.googlecode.iterm2.plist in a binary format
# What you need to do is basically copy that somewhere, convert to xml and remove color schemes in the xml files.
$ cd /tmp/
$ cp ~/Library/Preferences/com.googlecode.iterm2.plist .
$ plutil -convert xml1 com.googlecode.iterm2.plist
$ vi com.googlecode.iterm2.plist
View git_mergetool.sh
+--------------------------------+
| LOCAL | BASE | REMOTE |
+--------------------------------+
| MERGED |
+--------------------------------+
Local : The branch merging INTO
Base : The most recent shared version. This is where diffget
@AndrewRussellHayes
AndrewRussellHayes / caseless_grep.sh
Created Nov 27, 2014
case insensitive grep .. its the '(?i)' part
View caseless_grep.sh
egrep -H -n -R -S --exclude-dir=private -e "(?i)andrew" *
You can’t perform that action at this time.