Skip to content

Instantly share code, notes, and snippets.

View willgarcia's full-sized avatar
🌴

William Garcia willgarcia

🌴
  • Brisbane, Australia
View GitHub Profile
@willgarcia
willgarcia / gist:487b50c76902f7358909
Last active September 9, 2015 10:38 — forked from hd-deman/gist:d856151147ab9c3c3564
Downgrade Boot2Docker and Docker from 1.5.0 to 1.4.1 on OS X
* brew tap homebrew/boneyard
* cd $( brew --prefix )
* brew versions docker
git_hash = $(brew versions docker | awk '$1 == "1.4.1" {print $4}')
* git checkout $git_hash Library/Formula/docker.rb
* brew unlink docker
* brew install docker
* brew switch docker 1.4.1
* docker --version
@willgarcia
willgarcia / visualvm.md
Last active September 7, 2015 19:27
visualvm

HOST

brew install Caskroom/cask/visualvm + Add a remote

REMOTE

Policy file jstatd.all.policy content: grant codebase "file:/usr/java/jdk1.7.0_80/lib/tools.jar" { permission java.security.AllPermission; };

Description

When using Homebrew (http://brew.sh) and searching formulas or pull requests you may get the dreaded error message: Github API Rate limit exceeded

Let's fix that! (yeah!)


Short version

Create a new Personal Token in your Github Account Settings (Sidebar: Applications) and then copy the Token. In the Terminal, use export HOMEBREW_GITHUB_API_TOKEN=YOURAPITOKENWITHFUNKYNUMBERSHERE (change that to your API Token) or add that to your .bash_profile and then do source .bash_profile.

@willgarcia
willgarcia / gist:959bc949099301149041
Created October 9, 2014 07:46
git clone single branch
git clone <url> --branch <branch> --single-branch [<folder>]
[ $count -gt 0 && $someVar != $var] # double condition
if myfunc && [ ... ] # function condition
# explode on ","
function explode(){
local types=$1
array=(${types//,/ })
for type in $(echo $types | tr "," "\n") do
echo ${type[i]}
done
@willgarcia
willgarcia / gist:b872249517c6cd06efdc
Created September 22, 2014 07:18
Merge two image
brew install imagemagick
convert +append a.png b.png # horizontal merge
convert +append a.png b.png # vertical merge
@willgarcia
willgarcia / gist:f4567d2e326b3b927518
Created August 2, 2014 09:57
git edit old commit messages
git rebase -i HEAD~(count)
# pick 123456 bad message
->
# edit 123456 bad message
git commit --amend
git rebase --continue
git push -f
@willgarcia
willgarcia / git-squash
Created July 31, 2014 08:12
git squash
git checkout branche-dest
git merge --squash branche-dev
git commit
git push
#HIDDEN APPLICATIONS, HIDDEN FILES
defaults write com.apple.finder AppleShowAllFiles TRUE
#focus automatically follow the mouse to any Terminal window.
defaults write com.apple.terminal FocusFollowsMouse -string true
#Disable Dashboard in Mac OS X
defaults write com.apple.dashboard mcx-disabled -boolean true && killall Dock
./android update sdk --no-ui --obsolete --force # SDK Update