Skip to content

Instantly share code, notes, and snippets.

@nasrulhazim
nasrulhazim / change-mysql-data-directory-in-osx.md
Created April 8, 2017 10:20
Change MySQL Data Directory in OSX

Stop the MySQL Service

I'm using Homebrew to stop the service

brew services stop mysql

Locate MySQL Data Directory

@geotheory
geotheory / unknown_pleasures.R
Last active January 31, 2022 12:36
Joy Division album cover with ggplot2
require(raster)
require(ggplot2)
pulsar = function(n){
x = seq(0,100, length=n)
norms = dnorm(x, mean=40, sd=6)*100 + dnorm(x, mean=60, sd=6)*50
noise1 = approx(sample(c(rep(0:8,2),18:19)), n = n, y=NULL)$y
noise2 = approx(sample(0:50), n = n, y=NULL)$y
noise3 = rnorm(n)
abs(norms + norms * noise1 + norms * noise2 * .1 + noise3)
@hadley
hadley / ds-training.md
Created March 13, 2015 18:49
My advise on what you need to do to become a data scientist...

If you were to give recommendations to your "little brother/sister" on things that they need to do to become a data scientist, what would those things be?

I think the "Data Science Venn Diagram" (http://drewconway.com/zia/2013/3/26/the-data-science-venn-diagram) is a great place to start. You need three things to be a good data scientist:

  • Statistical knowledge
  • Programming/hacking skills
  • Domain expertise

Statistical knowledge

@smithdanielle
smithdanielle / check.packages.r
Created April 1, 2014 13:23
Check if multiple R packages are installed. Install them if they are not,then load them into the R session.
# check.packages function: install and load multiple R packages.
# Check to see if packages are installed. Install them if they are not, then load them into the R session.
check.packages <- function(pkg){
new.pkg <- pkg[!(pkg %in% installed.packages()[, "Package"])]
if (length(new.pkg))
install.packages(new.pkg, dependencies = TRUE)
sapply(pkg, require, character.only = TRUE)
}
# Usage example
@labeneator
labeneator / RMySQL_works.sh
Created October 4, 2013 21:49
RMySQL OSX recipe
# Find your R home
$ echo "R.home()" | Rscript /dev/stdin
Loading required package: stats
Loading required package: methods
[1] "/usr/local/Cellar/r/3.0.1/R.framework/Resources"
# Make sure that you have the MySQL home var in your Renviron