adapted from this blog
# YAML
name: Jon
# YAML
object:
# source: http://st-on-it.blogspot.com/2010/01/how-to-move-folders-between-git.html | |
# First of all you need to have a clean clone of the source repository so we didn't screw the things up. | |
git clone git://server.com/my-repo1.git | |
# After that you need to do some preparations on the source repository, nuking all the entries except the folder you need to move. Use the following command | |
git filter-branch --subdirectory-filter your_dir -- -- all | |
# This will nuke all the other entries and their history, creating a clean git repository that contains only data and history from the directory you need. If you need to move several folders, you have to collect them in a single directory using the git mv command. |
adapted from this blog
# YAML
name: Jon
# YAML
object:
# This script was created to convert a directory full | |
# of markdown files into rst equivalents. It uses | |
# pandoc to do the conversion. | |
# | |
# 1. Install pandoc from http://johnmacfarlane.net/pandoc/ | |
# 2. Copy this script into the directory containing the .md files | |
# 3. Ensure that the script has execute permissions | |
# 4. Run the script | |
# | |
# By default this will keep the original .md file |
People
:bowtie: |
😄 :smile: |
😆 :laughing: |
---|---|---|
😊 :blush: |
😃 :smiley: |
:relaxed: |
😏 :smirk: |
😍 :heart_eyes: |
😘 :kissing_heart: |
😚 :kissing_closed_eyes: |
😳 :flushed: |
😌 :relieved: |
😆 :satisfied: |
😁 :grin: |
😉 :wink: |
😜 :stuck_out_tongue_winking_eye: |
😝 :stuck_out_tongue_closed_eyes: |
😀 :grinning: |
😗 :kissing: |
😙 :kissing_smiling_eyes: |
😛 :stuck_out_tongue: |
## regular case | |
foo <- function(a, b, c) a + b - c ## does something | |
foo2 <- function(b, c) b + c ## also some function | |
foo(a=1, b=2, c=5) | |
foo2(b=2, c=5) ## repeating list of multiple arguments | |
## passing a list | |
arg.list <- list(b=2, c=5) | |
do.call(foo, c(list(a=1), arg.list)) | |
do.call(foo2, arg.list) |
def yes_or_no(question): | |
reply = str(raw_input(question+' (y/n): ')).lower().strip() | |
if reply[0] == 'y': | |
return True | |
if reply[0] == 'n': | |
return False | |
else: | |
return yes_or_no("Uhhhh... please enter ") |
import sys | |
from ete2 import Tree | |
import random | |
def get_json(node): | |
# Read ETE tag for duplication or speciation events | |
if not hasattr(node, 'evoltype'): | |
dup = random.sample(['N','Y'], 1)[0] | |
elif node.evoltype == "S": | |
dup = "N" |
# restore_packages.R | |
# | |
# installs each package from the stored list of packages | |
# source: http://hlplab.wordpress.com/2012/06/01/transferring-installed-packages-between-different-installations-of-r/ | |
load("~/installed_packages.rda") | |
for (count in 1:length(installedpackages)) { | |
install.packages(installedpackages[count]) | |
} |
.highlight { background: #ffffff; } | |
.highlight .c { color: #999988; font-style: italic } /* Comment */ | |
.highlight .err { color: #a61717; background-color: #e3d2d2 } /* Error */ | |
.highlight .k { font-weight: bold } /* Keyword */ | |
.highlight .o { font-weight: bold } /* Operator */ | |
.highlight .cm { color: #999988; font-style: italic } /* Comment.Multiline */ | |
.highlight .cp { color: #999999; font-weight: bold } /* Comment.Preproc */ | |
.highlight .c1 { color: #999988; font-style: italic } /* Comment.Single */ | |
.highlight .cs { color: #999999; font-weight: bold; font-style: italic } /* Comment.Special */ | |
.highlight .gd { color: #000000; background-color: #ffdddd } /* Generic.Deleted */ |
#!/usr/bin/env python | |
# USAGE | |
# python create_consensus_taxonomy.py X Y Z A | |
# where X is the taxonomy mapping file for all NR seqs, Y is the representative | |
# file (i.e. one of the rep_set/ files with the 119 release), Z is the OTU | |
# mapping file created from running pick_otus.py, and A is the output | |
# consensus mapping file | |
from sys import argv |