Skip to content

Instantly share code, notes, and snippets.

import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import time
data = []
for n_elements in [100, 1000, 10000, 100000]:
a = range(n_elements)
sa = set(a)
b = np.array(a) + 50
/*!
* Bootstrap v3.2.0 (http://getbootstrap.com)
* Copyright 2011-2014 Twitter, Inc.
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
*//*! normalize.css v3.0.1 | MIT License | git.io/normalize */html{font-family:sans-serif;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%}body{margin:0}article,aside,details,figcaption,figure,footer,header,hgroup,main,nav,section,summary{display:block}audio,canvas,progress,video{display:inline-block;vertical-align:baseline}audio:not([controls]){display:none;height:0}[hidden],template{display:none}a{background:0}a:active,a:hover{outline:0}abbr[title]{border-bottom:1px dotted}b,strong{font-weight:700}dfn{font-style:italic}h1{margin:.67em 0;font-size:2em}mark{color:#000;background:#ff0}small{font-size:80%}sub,sup{position:relative;font-size:75%;line-height:0;vertical-align:baseline}sup{top:-.5em}sub{bottom:-.25em}img{border:0}svg:not(:root){overflow:hidden}figure{margin:1em 40px}hr{height:0;-webkit-box-sizing:content-box;-moz-box-sizing:cont
@mattions
mattions / .screenrc
Created May 9, 2015 18:59
Sane screen rc default
hardstatus alwayslastline '%{= G}[ %{G}%H %{g}][%= %{= w}%?%-Lw%?%{= R}%n*%f %t%?%{= R}(%u)%?%{= w}%+Lw%?%= %{= g}][ %{y}Load: %l %{g}][%{B}%Y-%m-%d %{W}%c:%s %{g}]'
startup_message off
termcapinfo xterm* ti@:te@
backtick 1 5 5 true
termcapinfo rxvt* 'hs:ts=\E]2;:fs=\007:ds=\E]2;\007'
#!/bin/sh
#
# purge-old-kernels - remove old kernel packages
# Copyright (C) 2012 Dustin Kirkland <kirkland@ubuntu.com>
#
# Authors: Dustin Kirkland <kirkland@ubuntu.com>
# Kees Cook <kees@ubuntu.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
def _save_more_extensions(filename, extensions=['png', 'svg', 'pdf']):
for ext in extensions:
comp_filename = "{0}.{1}".format(filename, ext)
plt.savefig(comp_filename, dpi=300)
print "Saved plot: {0}".format(comp_filename)

Handy commands

Extract bam according to a bed file

bedtools intersect -abam path/to/input.bam -b path/to/regions.bed > out.bam

Extract region of a VCF

from pysam import VariantFile
import time
def count_oldvar_reg(vcffile_reg, labels=["OLDVARS", "OLDVARS_A", "OLDVARS_B"]):
t_start = time.time()
bcf_in = VariantFile(vcffile_reg)
total = 0
reg = 0
for rec in bcf_in:
# blackkiwi - production app
FROM mattions/webber:1.0
MAINTAINER mattions "mattions@gmail.com"
ENV DEBIAN_FRONTEND noninteractive
ENV PYTHONUNBUFFERED 1
RUN apt-get update && apt-get -qy install\
python3 \
# Upgrade your requirements
# - Finds outdated package with pip
# - install latest stable version
# - Update the requirements with the latest
pip list --outdated | cut -d' ' -f1 | xargs pip install --upgrade
pip freeze > requirements.txt

Your Vision

What is a vision?

Your vision answers the question "What do I want?" A clear vision help you communicate why you're here and what impact you're going to have.

Your vision should be aligned with the company vision, with your manager's V2MOM, and it should be personal. It should be an honest reflection of your own vision for your own work.

If you manage a team, it should be reflective of the purpose of the team and your collective impact.