Skip to content

Instantly share code, notes, and snippets.

View pditommaso's full-sized avatar
💭
Vita brevis, ars longa

Paolo Di Tommaso pditommaso

💭
Vita brevis, ars longa
View GitHub Profile
import luigi
from luigis_monkey_wrench import *
REF='human_17_v37.fasta'
INDIVIDUALS=['NA06984','NA07000']
SAMPLES=['1','2']
BASENAME='.ILLUMINA.low_coverage.17q_'
PICARDDIR='/sw/apps/bioinfo/picard/1.69/kalkyl/'
KNOWNSITES='/proj/g2014207/labs/gatk/ALL.chr17.phase1_integrated_calls.20101123.snps_indels_svs.genotypes.vcf'
#!/bin/bash
# bash generate random alphanumeric string
#
dd bs=18 count=1 if=/dev/urandom 2>/dev/null | base64 | tr +/ 0A
@pditommaso
pditommaso / Git notes
Last active February 14, 2017 17:52 — forked from richardcornish/git.md
Start
=====
1. Install Git
http://git-scm.com/download/mac
(But consider using Homebrew)
2. Make a GitHub account
https://github.com/
3. Open Terminal
#!/bin/bash
# References
# http://www.computerhope.com/unix/nc.htm#03
# https://github.com/daniloegea/netcat
# http://unix.stackexchange.com/questions/26715/how-can-i-communicate-with-a-unix-domain-socket-via-the-shell-on-debian-squeeze
# http://unix.stackexchange.com/questions/33924/write-inside-a-socket-open-by-another-process-in-linux/33982#33982
# http://www.linuxjournal.com/content/more-using-bashs-built-devtcp-file-tcpip
# http://www.dest-unreach.org/socat/
# http://stuff.mit.edu/afs/sipb/machine/penguin-lust/src/socat-1.7.1.2/EXAMPLES
#!/usr/bin/env python
"""Get download stats for releases from GitHub.
Needs development version of github3.
pip install github3
pip install git+https://github.com/sigmavirus24/github3.py.git
"""
import github3
repo = github3.repository("chapmanb", "bcbio.variation")
@pditommaso
pditommaso / memusg
Created August 27, 2014 15:08 — forked from netj/memusg
#!/usr/bin/env bash
# memusg -- Measure memory usage of processes
# Usage: memusg COMMAND [ARGS]...
#
# Author: Jaeho Shin <[email protected]>
# Created: 2010-08-16
set -um
# check input
[ $# -gt 0 ] || { sed -n '2,/^#$/ s/^# //p' <"$0"; exit 1; }
#!/bin/sh
remove_dangling() {
echo "Removing dangling images ..."
docker rmi $(docker images -f dangling=true -q)
}
remove_stopped_containers() {
echo "Removing stopped containers ..."
docker rm $(docker ps -qa)

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
import System.Environment
import Data.List.Split
import Data.List
import qualified Data.Map.Strict as Map
main = do
[f] <- getArgs
contents <- readFile f
putStr . unlines . map unwords . map (kmers 6) . getSequences $ contents
/* Sample use cases of @Builder AST which is added in Groovy 2.3 */
import groovy.transform.builder.*
import groovy.transform.ToString
//DefaultStrategy
@ToString(includeNames=true)
@Builder(builderStrategy=DefaultStrategy)
class Person {
String name