Skip to content

Instantly share code, notes, and snippets.

View tjmahr's full-sized avatar
🍍
sampling

TJ Mahr tjmahr

🍍
sampling
View GitHub Profile
@fnichol
fnichol / README.md
Created March 12, 2011 20:52
Download a cacert.pem for RailsInstaller

Why?

There is a long standing issue in Ruby where the net/http library by default does not check the validity of an SSL certificate during a TLS handshake. Rather than deal with the underlying problem (a missing certificate authority, a self-signed certificate, etc.) one tends to see bad hacks everywhere. This can lead to problems down the road.

From what I can see the OpenSSL library that Rails Installer delivers has no certificate authorities defined. So, let's go fetch some from the curl website. And since this is for ruby, why don't we download and install the file with a ruby script?

Installation

The Ruby Way! (Fun)

@mbostock
mbostock / .block
Last active January 23, 2020 07:04
Scatterplot Matrix
license: gpl-3.0
border: no
height: 960
redirect: https://observablehq.com/@d3/scatterplot-matrix
@mbostock
mbostock / .block
Last active July 2, 2023 13:49 — forked from mbostock/.block
Scatterplot Matrix Brushing
license: gpl-3.0
border: no
height: 960
redirect: https://observablehq.com/@d3/brushable-scatterplot-matrix
@mbostock
mbostock / .block
Last active February 9, 2016 02:13 — forked from dchud/README.md
Streams
license: gpl-3.0
@hadley
hadley / .gitignore
Last active February 25, 2024 02:10
Benchmark different ways of reading a file
.Rproj.user
.Rhistory
.RData
*.Rproj
*.html
@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

@johnmyleswhite
johnmyleswhite / statistical_maxims.md
Created December 1, 2015 15:25
Statistical Maxims
  • Correlation is not causation (???)
  • No causation without manipulation. (Holland)
  • All models are wrong, some are useful. (Box)
  • Statistics is the science of uncertainty. (arguably Tukey)
  • Statistics is the science of learning from experience, especially experience that arrives a little bit at a time. (Efron)
# Some fake data
library(dplyr); library(rstan)
# Write out the data generation with known parameters
# Set the number of individuals
n_ind <- 50
@teknikqa
teknikqa / lastfm_delete_loved.js
Created May 7, 2017 06:38
Bulk delete Last.FM scrobbles & loved tracks
// On the Last.FM website go to the page which lists the tracks that you have loved.
// Open Chrome DevTools (or Firefox or any modern browser that has a built in Javacript Console)
// and run the following command.
// This basically clicks on all the delete buttons on the page and reloads the page.
jQuery('.love-button--loved').each(function(_, b) {
b.click();
});
location.reload();
@mike-lawrence
mike-lawrence / gp_regression.stan
Last active April 7, 2020 18:15
GP Regression example
functions{
// GP: computes noiseless Gaussian Process
vector GP(real volatility, real amplitude, vector normal01, int n_x, real[] x ) {
matrix[n_x,n_x] cov_mat ;
real amplitude_sq_plus_jitter ;
amplitude_sq_plus_jitter = amplitude^2 + 1e-6 ;
cov_mat = cov_exp_quad(x, amplitude, 1/volatility) ;
for(i in 1:n_x){
cov_mat[i,i] = amplitude_sq_plus_jitter ;
}