Skip to content

Instantly share code, notes, and snippets.

View alexg9010's full-sized avatar

Alexander Blume alexg9010

View GitHub Profile
@leipzig
leipzig / mycd.sh
Created January 21, 2012 03:36
directory based history bash profile
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";
@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active June 25, 2024 07:26
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@stevenworthington
stevenworthington / ipak.R
Created July 25, 2012 19:44
Install and load multiple R packages at once
# 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)
}
@hotoo
hotoo / convert.sh
Last active April 15, 2023 01:15
convert vimwiki to markdown: `sed -f ex -i *.md`
#!/usr/bin/env bash
for x
do
filename=$(echo $x|sed -e "s/\.wiki$/.md/")
sed -f ex $x > $filename
done
@uupaa
uupaa / image.resize.in.github.flavored.markdown.md
Last active June 25, 2024 22:04
image resize in github flavored markdown.

Image source

https://gyazo.com/eb5c5741b6a9a16c692170a41a49c858.png

Try resize it!

  • ![](https://gyazo.com/eb5c5741b6a9a16c692170a41a49c858.png | width=100)
@wizioo
wizioo / gitignore_per_git_branch.md
Last active June 25, 2024 15:18
HowTo have specific .gitignore for each git branch

How to have specific .gitignore for each git branch

Objective

My objective is to have some production files ignored on specific branches. Git doesn't allow to do it.

Solution

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.

@andrewparkermorgan
andrewparkermorgan / rnaseq.R
Created March 16, 2016 15:25
Make coverage plots with splice-junction arcs in R using Bioconductor packages and ggplot2/grid.
# 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
@soxofaan
soxofaan / README.md
Last active January 19, 2024 17:48
Simple pretty CSV and TSV file viewer.
@slavailn
slavailn / annotate_MACS2_peaks.R
Created November 18, 2017 00:12
Annotate MACS2 peaks using ChIPpeakAnno
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
@rnwolf
rnwolf / spacemacs-keybindings.md
Last active February 24, 2024 08:45 — forked from kiambogo/spacemacs-keybindings
spacemacs keybindings that i need to learn