Skip to content

Instantly share code, notes, and snippets.

View rileytwo's full-sized avatar
🌺

Riley Roach rileytwo

🌺
  • Kansas City, Missouri
View GitHub Profile
@supermarin
supermarin / .env
Last active April 14, 2025 02:01
Colored `man` pages on OSX
# ZSH / BASH users
# Add this to your .env, .bashrc, .zshrc, or whatever file you're using for environment
man() {
env \
LESS_TERMCAP_mb=$(printf "\e[1;31m") \
LESS_TERMCAP_md=$(printf "\e[1;31m") \
LESS_TERMCAP_me=$(printf "\e[0m") \
LESS_TERMCAP_se=$(printf "\e[0m") \
LESS_TERMCAP_so=$(printf "\e[1;44;33m") \
These code snippets have been tested on R 3.1.0 and Mac OS 10.9.3. They presumably do *not* work on R 2.X!
## Enter these commands in the Mac OS Terminal
# use faster vecLib library
cd /Library/Frameworks/R.framework/Resources/lib
ln -sf /System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Versions/Current/libBLAS.dylib libRblas.dylib
# return to default settings
cd /Library/Frameworks/R.framework/Resources/lib
#!/usr/bin/ruby
# Create display override file to force Mac OS X to use RGB mode for Display
# see http://embdev.net/topic/284710
require 'base64'
data=`ioreg -l -d0 -w 0 -r -c AppleDisplay`
edids=data.scan(/IODisplayEDID.*?<([a-z0-9]+)>/i).flatten
vendorids=data.scan(/DisplayVendorID.*?([0-9]+)/i).flatten
@nicebread
nicebread / Ruscio2008_cor_generate.R
Created November 9, 2012 13:42
Ruscio - Code for generating correlating variables with arbitrary distributions
## This code snippet is taken from Ruscio, J., & Kaczetow, W. (2008). Simulating Multivariate Nonnormal Data Using an Iterative Algorithm. Multivariate Behavioral Research, 43(3), 355–381.
## In the original code were some errors; this is a cleaned version.
## 2012 Felix Schönbrodt
#' @param Pop List with empirical samples
#' @param rho The correlation to be induced