Skip to content

Instantly share code, notes, and snippets.

View kwcooper's full-sized avatar
🧠
User is typing...

Keiland kwcooper

🧠
User is typing...
View GitHub Profile
@nlgranger
nlgranger / sort_pdist.py
Created July 27, 2018 15:49
sort pairwise distance matrix
# like https://gmarti.gitlab.io/ml/2017/09/07/how-to-sort-distance-matrix.html
# but using just 4 lines of code thanks to 'optimal_ordering' argument
# added to scipy.cluster.hierarchy.linkage
import matplotlib.pyplot as plt
import numpy as np
from scipy.cluster.hierarchy import linkage
# distance matrix
m = np.zeros((500, 500))
@milanboers
milanboers / clone.bash
Last active May 2, 2024 20:03
Clone all repositories of a Github user
curl -s https://api.github.com/users/milanboers/repos | grep \"clone_url\" | awk '{print $2}' | sed -e 's/"//g' -e 's/,//g' | xargs -n1 git clone