This file contains hidden or 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
#!/usr/bin/env python | |
import subprocess | |
def run_and_parse_subprocess(**popen_args): | |
with subprocess.Popen(**popen_args) as p: | |
for line in p.stdout: | |
yield line.decode('utf-8') | |
if p.poll() == 0: |
This file contains hidden or 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
#!/usr/bin/env bash | |
# | |
# Usage: ./install_cudnn.sh <tar file> | |
set -ex | |
[[ -n "${1}" ]] \ | |
&& tar -xzvf ${1} -C /tmp \ | |
&& cp /tmp/cuda/include/cudnn.h /usr/local/cuda/include \ | |
&& cp /tmp/cuda/lib64/libcudnn* /usr/local/cuda/lib64 \ |
This file contains hidden or 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
#!/usr/bin/env python | |
import numpy as np | |
from scipy import stats | |
class HotellingsT2(object): | |
def __init__(self, alpha): | |
self.anomaly_score_threshold = stats.chi2.ppf(q=(1 - alpha), df=1) |
This file contains hidden or 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
#!/usr/bin/env Rscript | |
if(length(argv <- commandArgs(trailingOnly = TRUE)) > 0) { | |
install.packages(pkgs = argv, | |
repos = c(CRAN = 'https://cran.rstudio.com/'), | |
dependencies = TRUE) | |
} else { | |
message('Nothig to do.') | |
} |
This file contains hidden or 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
defaults write com.apple.desktopservices DSDontWriteNetworkStores True |
This file contains hidden or 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
--- | |
version: '3' | |
services: | |
hugo: | |
container_name: hugo | |
image: dceoy/hugo:latest | |
user: ${UID}:${GID} | |
ports: | |
- 1313:1313 |
This file contains hidden or 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
#!/usr/bin/env bash | |
# | |
# Usage: | |
# ./download_pkg.sh \ | |
# --py-pkg ./py_requirements.txt \ | |
# --r-pkg ./r_requirements.txt \ | |
# --py-dir ./src/py \ | |
# --r-dir ./src/r | |
# | |
# Options: |
This file contains hidden or 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
#!/usr/bin/env python | |
import io | |
import os | |
import pandas as pd | |
def read_vcf(path): | |
with open(path, 'r') as f: | |
lines = [l for l in f if not l.startswith('##')] |
This file contains hidden or 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
python setup.py bdist_wheel | |
twine upload dist/*.whl |
This file contains hidden or 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
#!/usr/bin/env bash | |
# | |
# # Mount vboxsf | |
# $ sudo mount -t vboxsf vbox ~/synced | |
set -uex | |
v=$(curl http://download.virtualbox.org/virtualbox/LATEST.TXT) | |
curl http://download.virtualbox.org/virtualbox/${v}/VBoxGuestAdditions_${v}.iso -o /tmp/vbga.iso | |
sudo mount -t iso9660 /tmp/vbga.iso /mnt/ |