Skip to content

Instantly share code, notes, and snippets.

View mdshw5's full-sized avatar

Matt Shirley mdshw5

View GitHub Profile
@andrie
andrie / repr options.R
Created September 25, 2015 15:16
Changing plot size in Jupyter IRkernel
library(repr)
# Change plot size to 4 x 3
options(repr.plot.width=4, repr.plot.height=3)
curve(sin(x), from = 0, to=2*pi, n = 100)
# Change plot size to 8 x 3
options(repr.plot.width=8, repr.plot.height=3)
curve(sin(x), from = 0, to=4*pi, n = 200)
@krishnakummar
krishnakummar / donut-example.py
Created September 11, 2015 11:56
Donut chart using python matplotlib
import matplotlib.pyplot as plt
# The slices will be ordered and plotted counter-clockwise.
labels = 'Frogs', 'Hogs', 'Dogs', 'Logs'
sizes = [15, 30, 45, 10]
colors = ['yellowgreen', 'gold', 'lightskyblue', 'lightcoral']
explode = (0, 0, 0, 0) # explode a slice if required
plt.pie(sizes, explode=explode, labels=labels, colors=colors,
autopct='%1.1f%%', shadow=True)
@derrickturk
derrickturk / sf_sqlite.py
Created September 3, 2015 18:24
Access SQLite db in Spotfire IronPython. Would literally murder for with blocks.
import clr
clr.AddReferenceToFileAndPath(r'X:\path\to\System.Data.SQLite.dll')
import System.Data.SQLite as sql
try:
db = sql.SQLiteConnection(r'DataSource=X:\path\to\Chinook_Sqlite.sqlite;Version=3')
db.Open()
command = sql.SQLiteCommand('select * from Artist', db)
try:
reader = command.ExecuteReader()
@PurpleBooth
PurpleBooth / README-Template.md
Last active June 19, 2024 07:39
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

@darcyliu
darcyliu / centos7_timechine.sh
Last active April 25, 2022 18:17
Install Time Machine service on CentOS 7
# Install Time Machine service on CentOS 7
# http://netatalk.sourceforge.net/wiki/index.php/Netatalk_3.1.7_SRPM_for_Fedora_and_CentOS
# http://confoundedtech.blogspot.com/2011/07/draft-draft-ubuntu-as-apple-time.html
yum install -y rpm-build gcc make wget
# install netatalk
yum install -y avahi-devel cracklib-devel dbus-devel dbus-glib-devel libacl-devel libattr-devel libdb-devel libevent-devel libgcrypt-devel krb5-devel mysql-devel openldap-devel openssl-devel pam-devel quota-devel systemtap-sdt-devel tcp_wrappers-devel libtdb-devel tracker-devel
yum install -y bison docbook-style-xsl flex dconf
@cuibonobo
cuibonobo / README.md
Last active November 8, 2019 08:02
VGA Passthrough on virtual machines in CentOS 7

Mainline kernel

After your fresh CentOS 7 setup (make sure you install the QEMU/KVM virtualization tools and virt-manager), install the mainline kernel:

sudo rpm --import https://www.elrepo.org/RPM-GPG-KEY-elrepo.org
sudo rpm -Uvh http://www.elrepo.org/elrepo-release-7.0-2.el7.elrepo.noarch.rpm
sudo yum --enablerepo=elrepo-kernel install kernel-ml
sudo yum -y update
@hadley
hadley / ds-training.md
Created March 13, 2015 18:49
My advise on what you need to do to become a data scientist...

If you were to give recommendations to your "little brother/sister" on things that they need to do to become a data scientist, what would those things be?

I think the "Data Science Venn Diagram" (http://drewconway.com/zia/2013/3/26/the-data-science-venn-diagram) is a great place to start. You need three things to be a good data scientist:

  • Statistical knowledge
  • Programming/hacking skills
  • Domain expertise

Statistical knowledge

@danielecook
danielecook / sra_to_fastq.sh
Last active June 21, 2019 07:26
Download data from the sequence read archive and convert to fastq format
Download_SRP_Runs() {
SRP_IDs=`esearch -db sra -query $1 | efetch -format docsum | xtract -pattern DocumentSummary -element Run@acc | tr '\t' '\n'`
for r in ${SRP_IDs}; do
url="ftp://ftp-trace.ncbi.nih.gov/sra/sra-instant/reads/ByRun/sra/SRR/${r:0:6}/${r}/${r}.sra"
wget $url
done;
}
Download_SRP_Runs <SRP ID GOES HERE>
@xbeta
xbeta / README.md
Last active June 19, 2024 08:46
Macbook Pro Bluetooth + WiFi 2.4GHz interference fix for Mavericks
## The Reviewer
I, the reviewer, promise:
1. to not hide behind a screen of anonymity
2. to be open and honest with you (the authors) at all times
3. to be constructive in my criticism
4. within the rules given to me by the journal, to assist you in every way I ethically can to get your manuscript published,by providing criticism and praise that is valid and relevant
5. It is your paper, not mine. I will not try to turn author’s paper into a paper I would have written.