Skip to content

Instantly share code, notes, and snippets.

View mikelove's full-sized avatar

Michael Love mikelove

View GitHub Profile
unbind C-b
set -g prefix C-o
bind C-o send-prefix
set -g default-terminal "xterm-256color"
@mikelove
mikelove / .bashrc
Last active March 25, 2021 18:11
.bashrc
alias ls='ls -G'
alias ll='ls -lh'
alias rm='rm -i'
alias mv='mv -i'
alias cp='cp -i'
alias R='R --quiet'
alias Rdevel='/home/love/bin/R/bin/R --quiet'
alias emacs='emacs -nw'
@mikelove
mikelove / biocII.Rpres
Last active August 29, 2015 14:20
This is the Rpres file, the next gist, biocII.html can be downloaded and viewed in a browser.
How It's Done: Bioc II
===
author: Michael Love
date: 30 April 2015
autosize: false
width: 1600
Survey results (n=28)
===
@mikelove
mikelove / biocII.html
Created April 30, 2015 23:16
biocII.html
This file has been truncated, but you can view the full file.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>How It's Done: Bioc II</title>
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
@mikelove
mikelove / rc.local
Created May 7, 2015 23:01
/etc/rc.local
rfkill block bluetooth
echo 22 > /sys/class/backlight/acpi_video0/brightness
exit 0
@mikelove
mikelove / gist:3e8b7766ee3ac97dc53c
Created May 14, 2015 00:28
syndaemon: no touchpad while typing
syndaemon -i 2 -K -d
@mikelove
mikelove / citation.tex
Last active August 29, 2015 14:22
format all citations in bibtex file
\documentclass{article}
\pagenumbering{gobble}
\hyphenpenalty=10000
\exhyphenpenalty=10000
\begin{document}
\nocite{*}
\bibliographystyle{apalike}
\bibliography{citations}
\end{document}
@mikelove
mikelove / elnino.R
Created August 20, 2015 20:15
elnino
library(RColorBrewer)
palette(brewer.pal(4,"Set1"))
x <- read.table("snow.txt", header=TRUE)
x$EN <- factor(x$EN, c("n","m","s","vs"))
levels(x$EN) <- c("no/weak", "medium", "strong", "very strong")
plot(x$Tot, col=x$EN, pch=20, cex=3,
xaxt="n", xlab="",
ylab="total snowfall", main="Boston snowfall")
abline(h=1:5 * 20, col=rgb(0,0,0,.5))
axis(1, 1:nrow(x), as.character(x$Season), las=2)
@mikelove
mikelove / fastVST.R
Created August 28, 2015 17:14
fast VST
library(DESeq2)
# simulate data
dds <- makeExampleDESeqDataSet(n=80000,m=100)
# this takes 10 seconds on my machine
dds <- estimateSizeFactors(dds)
baseMean <- rowMeans(counts(dds, normalized=TRUE))
sum(baseMean > 1)
idx <- sample(which(baseMean > 5), 1000)
dds.sub <- dds[idx, ]
for (f in list.files()) { print(f); test(".", sub("test_(.*)\\.R","\\1",f)) }