start new:
tmux
start new with session name:
tmux new -s myname
function mycd() | |
{ | |
#if this directory is writable then write to directory-based history file | |
#otherwise write history in the usual home-based history file | |
tmpDir=$PWD | |
echo "#"`date '+%s'` >> $HISTFILE | |
echo $USER' has exited '$PWD' for '$@ >> $HISTFILE | |
builtin cd "$@" # do actual cd | |
if [ -w $PWD ]; then export HISTFILE="$PWD/.dir_bash_history"; touch $HISTFILE; chmod --silent 777 $HISTFILE; | |
else export HISTFILE="$HOME/.bash_history"; |
# ipak function: install and load multiple R packages. | |
# check to see if packages are installed. Install them if they are not, then load them into the R session. | |
ipak <- function(pkg){ | |
new.pkg <- pkg[!(pkg %in% installed.packages()[, "Package"])] | |
if (length(new.pkg)) | |
install.packages(new.pkg, dependencies = TRUE) | |
sapply(pkg, require, character.only = TRUE) | |
} |
#!/usr/bin/env bash | |
for x | |
do | |
filename=$(echo $x|sed -e "s/\.wiki$/.md/") | |
sed -f ex $x > $filename | |
done |
My objective is to have some production files ignored on specific branches. Git doesn't allow to do it.
My solution is to make a general .gitignore
file and add .gitignore.branch_name
files for the branches I want to add specific file exclusion.
I'll use post-checkout hook to copy those .gitignore.branch_name in place
of .git/info/exclude
each time I go to the branch with git checkout branch_name
.
# rnaseq.R | |
# plots related to RNAseq data | |
library(GenomicAlignments) | |
library(GenomicRanges) | |
library(ggplot2) | |
library(grid) | |
#library(gtable) # for combining plots vertically | |
#' Make a 'sashimi plot': coverage plus splice events |
These are some simple bash functions and scripts for making CSV/TSV files prettier on the command line
see http://stefaanlippens.net/pretty-csv.html for more information.
library("ChIPpeakAnno") | |
library("GenomicRanges") | |
library("org.At.tair.db") | |
library("TxDb.Athaliana.BioMart.plantsmart28") | |
library("biomaRt") | |
# Annotate genomic intervals in bed format using ChIPpeakAnno | |
# This script was designed for Arabidopsis, but can be easily changed for | |
# any other organism available through biomaRt |
Ref: https://gist.github.com/rnwolf/e09ae9ad6d3ac759767d129d52cab1f1
Key Binding | Description |
---|---|
SPC | < space > |
RET | < return > |
C | < ctrl > |
M | < alt >, M stands for Meta |