Skip to content

Instantly share code, notes, and snippets.

View FelixHenninger's full-sized avatar

Felix Henninger FelixHenninger

View GitHub Profile
@crsh
crsh / cohens_d_r.R
Last active May 12, 2020 15:17
Calculate Cohen's d_r and mean differences in measurement scale
mean_difference_r <- function(x, object) UseMethod("mean_difference_r", object)
mean_difference_r.lm <- function(x, object) {
x * sigma(object)
}
mean_difference_r.mlm <- function(x, object) {
x * sqrt(mean(sigma(object)^2))
}
# Usage:
# 1) Ctr+S downloads page to ~/Desktop/books.html
# 2) Run script
# 3) Find your books in /tmp/humble_books
# 4) Read them
# 5) Profit
cat ~/Desktop/books.html |
grep "https://dl.humble.com" |
sed -n -E 's/.data-web\=\"(https://dl.humble.com/([.]+).([a-z]+)?["]+)./\1 \2 \3/p' |
sed 's/&amp;/&/g' > /tmp/humble_books_list && cat /tmp/humble_books_list |
#!/usr/bin/env ruby
require 'open-uri'
require 'pathname'
require 'json'
def strip_hash(f)
ext = f.extname
if ext.include?("?")