Skip to content

Instantly share code, notes, and snippets.

@brentp
brentp / README.md
Last active October 12, 2023 15:21

Linkage Disequilibrium Calculation

This is complete taken from Ryan D on biostar: http://www.biostars.org/p/2909/#16419

It takes a region in a format like "chr2:1234-3456". If an rs number is specified after the region, it will output the R^2 for every SNP in that region with the requested SNP; otherwise, it is all-vs-all.

@TooTallNate
TooTallNate / mp3player.js
Created October 24, 2012 17:42
node.js command line MP3 player in 9 lines of code!
var fs = require('fs');
var lame = require('lame');
var Speaker = require('speaker');
fs.createReadStream(process.argv[2])
.pipe(new lame.Decoder())
.on('format', function (format) {
this.pipe(new Speaker(format));
});
@johanmeiring
johanmeiring / gist:3002458
Created June 27, 2012 08:32
"git lg" alias for pretty git log
# From http://garmoncheg.blogspot.com/2012/06/pretty-git-log.html
git config --global alias.lg "log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --"
@spicycode
spicycode / tmux.conf
Created September 20, 2011 16:43
The best and greatest tmux.conf ever
# 0 is too far from ` ;)
set -g base-index 1
# Automatically set window title
set-window-option -g automatic-rename on
set-option -g set-titles on
#set -g default-terminal screen-256color
set -g status-keys vi
set -g history-limit 10000
@lackac
lackac / gist:216060
Created October 22, 2009 16:14
A primitive way to ensure that your Passenger processes don't eat up your machine completely. It will kill any Rack app process that starts to eat more than 300MB RAM. I used this to find a leak in a Sinatra application.
#!/bin/bash
while :; do
stats=$(passenger-memory-stats | grep Rack)
if [ "$stats" != "" ]; then
echo $stats
echo $stats | egrep --color=always 'MB ([12][0-9]|[3-9])..\.. MB'
pid=$(echo $stats | egrep 'MB ([12][0-9]|[3-9])..\.. MB' | awk '{ print $1 }')
if [ "$pid" != "" ]; then
ps aux | grep $pid