Skip to content

Instantly share code, notes, and snippets.

@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
@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
@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 --"
@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));
});
@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.

@dypsilon
dypsilon / frontendDevlopmentBookmarks.md
Last active May 5, 2025 13:05
A badass list of frontend development resources I collected over time.
@trestletech
trestletech / README.md
Last active February 16, 2017 15:24
Shiny Example #4 for Bioconductor

Bioconductor Shiny Example #4

Example Shiny App showing an example of being embedded in a larger, non-Shiny workflow.

This is an example Shiny app featuring some basic analysis of Ovarian Cancer gene expression data collected on the Affymetrix U133A platform. We filter the available genes and samples down to a much smaller matrix to make reproducibility simpler for a broader audience. The R code involved in sampling the data is available in this Gist as an R-Markdown file, and the sampled data are available in this Gist as Rds files.

To run the application, install shiny (install.packages("shiny")) then run the following command:

library(shiny)

@timyates
timyates / Biostar77288.groovy
Created July 24, 2013 10:57
Groovy version of 'Low resolution sequence alignment visualization' by @lindenb: https://github.com/lindenb/jvarkit#biostar77288
import java.awt.Insets
import groovy.xml.StreamingMarkupBuilder
import groovy.transform.*
class Biostar77288 {
private int ALN_WIDTH = 1000
private Map<String,Seq> sequences = [:].withDefault { new Seq( name:it ) }
private int maxLength = 0
<html>
<head>
<script type="text/javascript">
//<![CDATA[
/* from R code https://github.com/genome-vendor/r-bioc-biostrings/blob/master/src/match_PWM.c */
function compute_pwm_score(pwm, S,offset)
{
var score=0.0;
@davfre
davfre / bamfilter_oneliners.md
Last active January 18, 2025 22:47
SAM and BAM filtering oneliners