Skip to content

Instantly share code, notes, and snippets.

View ryanholbrook's full-sized avatar

Ryan Holbrook ryanholbrook

View GitHub Profile
@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active July 4, 2024 17:58
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@mblondel
mblondel / letor_metrics.py
Last active April 24, 2024 19:43
Learning to rank metrics.
# (C) Mathieu Blondel, November 2013
# License: BSD 3 clause
import numpy as np
def ranking_precision_score(y_true, y_score, k=10):
"""Precision at rank k
Parameters
@tboggs
tboggs / dirichlet_plots.png
Last active February 13, 2024 03:25
A script to generate contour plots of Dirichlet distributions
dirichlet_plots.png
@kgilbert-cmu
kgilbert-cmu / formulaTools.R
Last active November 3, 2020 00:17
Formulas in R are hard to manipulate
# Kevin Gilbert
# CMU CS '14
# Formulas in R are hard to manipulate, and cannot have string functions applied to them. This fixes that.
# ---------- ---------- ---------- ---------- ----------
# given two formulas, merge their predictors
@walterreade
walterreade / virtualenv.txt
Last active October 9, 2022 06:41
Setting up standard virtualenv
### for brand-new only
sudo apt-get update
sudo apt-get install htop
sudo apt-get install build-essential
wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh
bash Miniconda3-latest-Linux-x86_64.sh
rm Miniconda3-latest-Linux-x86_64.sh
@gilbertw1
gilbertw1 / .Xresources
Last active December 2, 2022 10:51
XMonad Configuration
Xft.dpi: 120
Xft.antialias: true
Xft.hinting: true
Xft.rgba: rgb
Xft.hintstyle: hintslight
rofi.color-enabled: true
rofi.color-window: #282828, #282828, #268bd2
rofi.color-normal: #282828, #ffffff, #282828, #268bd2, #ffffff
rofi.color-active: #282828, #268bd2, #282828, #268bd2, #205171
@MMesch
MMesch / robust_splines_sklearn.py
Last active July 6, 2023 23:04
Robust Spline Regression with Scikit-Learn
#!/usr/bin/env python
"""
Robust B-Spline regression with scikit-learn
"""
import matplotlib.pyplot as plt
import numpy as np
import scipy.interpolate as si
from sklearn.base import TransformerMixin
from sklearn.pipeline import make_pipeline
@bshishov
bshishov / forecasting_metrics.py
Last active April 20, 2024 04:29
Python Numpy functions for most common forecasting metrics
import numpy as np
EPSILON = 1e-10
def _error(actual: np.ndarray, predicted: np.ndarray):
""" Simple error """
return actual - predicted
@behrica
behrica / maps.org
Last active August 15, 2021 09:51
Proof of concept for htmlwidget integration in org mode
renderDeps <- function(widget,dir=".",libdir="lib") {
  rendered <- htmltools::renderTags(widget)

  deps <- lapply(rendered1$dependencies, function(dep) {
    dep <- htmltools::copyDependencyToDir(dep, libdir, FALSE)
    dep <- htmltools::makeDependencyRelative(dep, dir, FALSE)
@tfeldmann
tfeldmann / duplicates.py
Last active May 26, 2024 03:18
Fast duplicate file finder written in python
#!/usr/bin/env python
"""
Fast duplicate file finder.
Usage: duplicates.py <folder> [<folder>...]
Based on https://stackoverflow.com/a/36113168/300783
Modified for Python3 with some small code improvements.
"""
import os
import sys