Skip to content

Instantly share code, notes, and snippets.

View jamieoliver's full-sized avatar

Jamie Oliver jamieoliver

View GitHub Profile
@jamieoliver
jamieoliver / cleanup-homebrew.sh
Created March 16, 2014 18:23
Homebrew: remove old package versions and downloaded files.
brew cleanup --force -s
rm -rf $(brew --cache)
@jamieoliver
jamieoliver / upgrade-rvm.sh
Created March 9, 2014 18:01
Upgrade RVM and Ruby versions.
# Upgrade RVM
rvm get stable
# Upgrade specific Ruby version
rvm upgrade 2.1.0
# Clean everything
rvm cleanup all
@jamieoliver
jamieoliver / fetch-pull-requests.sh
Created March 9, 2014 17:07
Configure a repository to fetch GitHub pull requests.
# Add the following to the appropriate [remote "<remote>"] section in the repository's .git/config
fetch = +refs/pull/*/head:refs/remotes/<remote>/pr/*
@jamieoliver
jamieoliver / push-all-tags.sh
Created March 9, 2014 16:48
Push all Git tags to a remote repository. Useful for keeping a fork up to date with the upstream repo.
git push <remote> --tags
@jamieoliver
jamieoliver / ssh-without-password.sh
Created March 9, 2014 16:46
Copy public key for the current user to a remote host.
ssh <user>@<host> 'mkdir -p .ssh'
cat ~/.ssh/id_rsa.pub | ssh <user>@<host> 'cat >> .ssh/authorized_keys'
brew update
brew versions FORMULA
cd `brew --prefix`
git checkout HASH Library/Formula/FORMULA.rb # use output of "brew versions"
brew install FORMULA
brew switch FORMULA VERSION
git checkout -- Library/Formula/FORMULA.rb # reset formula
## Example: Using Subversion 1.6.17
#
@jamieoliver
jamieoliver / global-gitignore.sh
Created March 6, 2014 07:39
Configure global .gitignore file.
git config --global core.excludesfile '~/.gitignore'
@jamieoliver
jamieoliver / .travis.yml
Created February 9, 2014 16:09
RVM commands needed when using Ruby on a non-Ruby Travis CI builder.
before_install:
- source ~/.rvm/scripts/rvm
- rvm use 1.9.3