This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# This script will install a Git pre-commit hook that stop accidental commits to master and develop branches. | |
# There is also a variant that includes a core.whitespace check. See pre-commit-2 below. | |
# Install in current Git repo: | |
# curl -fL https://gist.githubusercontent.com/stefansundin/9059706/raw/install-pre-commit.sh | sh | |
# Install with core.whitespace check: | |
# curl -fL https://gist.githubusercontent.com/stefansundin/9059706/raw/install-pre-commit.sh | sh -s pre-commit-2 | |
# Install with core.whitespace check and EOF-newline-check: | |
# curl -fL https://gist.githubusercontent.com/stefansundin/9059706/raw/install-pre-commit.sh | sh -s pre-commit-3 | |
# Install only core.whitespace check: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# This way you can customize which branches should be skipped when | |
# prepending commit message. | |
if [ -z "$BRANCHES_TO_SKIP" ]; then | |
BRANCHES_TO_SKIP=(master develop test) | |
fi | |
BRANCH_NAME=$(git symbolic-ref --short HEAD) | |
BRANCH_NAME="${BRANCH_NAME##*/}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# gap.py | |
# (c) 2013 Mikael Vejdemo-Johansson | |
# BSD License | |
# | |
# SciPy function to compute the gap statistic for evaluating k-means clustering. | |
# Gap statistic defined in | |
# Tibshirani, Walther, Hastie: | |
# Estimating the number of clusters in a data set via the gap statistic | |
# J. R. Statist. Soc. B (2001) 63, Part 2, pp 411-423 |