Skip to content

Instantly share code, notes, and snippets.

@adini121
adini121 / Useful_git_commands.md
Last active January 28, 2016 12:59
Useful git commands I encountered throughout my experience with Git

##Git commands I encountered throughout my git-experience

####Best Git practices

  1. Always review what's in the staging area before commiting to make sure you would only add/commit whats intended to be committed -> Saves you from pushing undesired objects to remote.
git status | git diff --cached
  1. Always fetch from remote before working in order to avoid (future) conflicts ####Regular git workflow for creating/adding/committing/pushing new files to (remote) repository
@tonymtz
tonymtz / gist:714e73ccb79e21c4fc9c
Created November 15, 2014 00:02
Uninstall XQuartz.app from OSX Yosemite
launchctl unload /Library/LaunchAgents/org.macosforge.xquartz.startx.plist
sudo launchctl unload /Library/LaunchDaemons/org.macosforge.xquartz.privileged_startx.plist
sudo rm -rf /opt/X11* /Library/Launch*/org.macosforge.xquartz.* /Applications/Utilities/XQuartz.app /etc/*paths.d/*XQuartz
sudo pkgutil --forget org.macosforge.xquartz.pkg
# Log out and log in
@stephenturner
stephenturner / explore-correlations.r
Created August 27, 2012 22:06
Exploring correlations with R using cor.prob and chart.Correlation
## Correlation matrix with p-values. See http://goo.gl/nahmV for documentation of this function
cor.prob <- function (X, dfr = nrow(X) - 2) {
R <- cor(X, use="pairwise.complete.obs")
above <- row(R) < col(R)
r2 <- R[above]^2
Fstat <- r2 * dfr/(1 - r2)
R[above] <- 1 - pf(Fstat, 1, dfr)
R[row(R) == col(R)] <- NA
R
}