Skip to content

Instantly share code, notes, and snippets.

View gregcaporaso's full-sized avatar
🌱

Greg Caporaso gregcaporaso

🌱
View GitHub Profile
@wasade
wasade / version_update.sh
Created May 1, 2012 23:59
version updater for biom-format
#!/bin/bash
OLD_VERSION=$1
NEW_VERSION=$2
cd trunk/examples
sed -ie "s/Biological Observation Matrix $OLD_VERSION/Biological Observation Matrix $NEW_VERSION/" *.biom
cd ../scripts
sed -ie "s/^__version__ = \"$OLD_VERSION\"/__version__ = \"$NEW_VERSION\"/" *.py
@gregcaporaso
gregcaporaso / Lecture20.ipynb
Last active October 12, 2015 07:47
IPython Notebook files used in Greg Caporaso's Fall 2012 BIO599 Computational Biology course. See the included README.md file for more details and licensing information.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@ElDeveloper
ElDeveloper / gist:4206016
Last active October 13, 2015 13:57
Current git branch in your bash prompt

Show the time, the current folder where you are working and the current branch if working on a git repository. Output looks like 19:41:40 Documents@master$ . If using an xterm-256 terminal emulator, hour should be green, cwd white and the branch red.

function egit (){                                                               
    function get_git_branch () {                                                
        command git rev-parse --abbrev-ref HEAD 2> /dev/null                    
    }                                                                           
    # git specific usage for branching                                          
    function branch_separator () {                                              
        if [[ -n $(get_git_branch) ]]                                           
@jtriley
jtriley / config
Created August 9, 2012 15:47
Example StarCluster plugin that tags all instances based on tags specified in the config
# This is an example config that assumes tagger.py is either in
# $HOME/.starcluster/plugins or lives somewhere in your $PYTHONPATH
[plugin tagger]
setup_class = tagger.TaggerPlugin
# add as many key=value pairs as you like separated by ','
tags = 'mykey=myvalue, mykey2=myvalue2'
[cluster default]
...
@wasade
wasade / sub
Last active September 7, 2017 22:01
Light weight mechanism to submit a job to torque based cluster. Logging is implicit, and all logs and standard out/err automatically placed in the current working directory.
#!/usr/bin/env python
r"""Cluster submission
Light helper script for submitting jobs to a cluster. For instance, to submit
a job that calls the command hostname, just use:
$ sub hostname
Additionally, you can specify the name of the job:
@deekayen
deekayen / 1-1000.txt
Last active March 27, 2024 21:34
1,000 most common US English words
the
of
to
and
a
in
is
it
you
that