Skip to content

Instantly share code, notes, and snippets.

View azadag's full-sized avatar

Azad Amir-Ghassemi azadag

  • Los Angeles
View GitHub Profile
@ChaosJohn
ChaosJohn / changeUnicodeToAsciiOfOhMyZshDefaultTheme.sh
Created November 22, 2017 06:26
Fix "➜" and "✗" of oh-my-zsh default theme making the cursor position wrong under some terminals(such as Mosh Chrome App, Termius[Chrome App Version, Mac Version, Windows Version])
#!/bin/sh
DIR="$HOME/.oh-my-zsh/custom/themes"
mkdir -p $DIR
cd $DIR
sed "s/➜/→/g;s/✗/×/g" $HOME/.oh-my-zsh/themes/robbyrussell.zsh-theme > robbyrussell.zsh-theme
# data from http://ec.europa.eu/eurostat/web/gisco/geodata/reference-data/population-distribution-demography/geostat
# Originally seen at http://spatial.ly/2014/08/population-lines/
# So, this blew up on both Reddit and Twitter. Two bugs fixed (southern Spain was a mess,
# and some countries where missing -- measure twice, submit once, damnit), and two silly superflous lines removed after
# @hadleywickham pointed that out. Also, switched from geom_segment to geom_line.
# The result of the code below can be seen at http://imgur.com/ob8c8ph
library(tidyverse)
@sterding
sterding / venn_pie_chart.r
Last active July 28, 2019 20:44
R script to generate multi-layer pie chart (or called it venn pieagram) to visualize the NGS reads distribution in different annotation regions
## data input (number of reads mapped to each category)
total=100
rRNA=5 # mapped to nuclear rRNA regions
mtRNA=7 # mapped to mitochondria genome
# for the rest of above, then we divide into different category, like http://www.biomedcentral.com/1741-7007/8/149 did.
intergenic=48
introns=12
exons=30
upstream=3
downstream=6
@christophergandrud
christophergandrud / stan_caterpillar.R
Last active October 24, 2017 22:25
Simple function to create caterpillar plots from rstan's stanfit objects
#' A function to create caterpillar plots from rstan's stanfit objects
#'
#' @param obj a \code{stanfit} object
#' @param pars character string, vector, or regular expression of paramater
#' labels that you would like to plot as declared in \code{model_code} from the
#' \code{\link{stan}} call.
#' @param pars_labels vector of parameter labels. Important: they must be in
#' the same order as in the \code{stanfit} object when \code{as.data.frame(obj)}
#' is called.
#' @param hpd logical. If \code{TRUE} then the 90% and 95% highest probability
@treycausey
treycausey / slopegraphs.py
Last active February 19, 2019 12:23
Slopegraphs in matplotlib
# Slopegraphs in matplotlib
# Trey Causey (@treycausey)
# Problems arise when equal values occur
# within the same time unit
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
units = ['A', 'B', 'C', 'D']
@sckott
sckott / map.geojson
Last active August 29, 2015 14:01
Zillow neighborhood maps in R to map
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@ramnathv
ramnathv / Makefile
Last active September 2, 2022 14:31
Rmd to IPython Notebook and HTML
all: example.ipynb example.html
example.md: example.Rmd
./knit
example.ipynb: example.md
notedown example.md | sed '/%%r/d' > example.ipynb
example.html: example.Rmd
R -e "knitr::knit2html('example.Rmd')"
@skranz
skranz / s_dplyr
Created March 21, 2014 07:48
Wrappers to dplyr's data modification functions like arrange, select,... that work with string arguments.
# Helper functions that allow string arguments for dplyr's data modification functions like arrange, select etc.
# Author: Sebastian Kranz
# Examples are below
#' Modified version of dplyr's filter that uses string arguments
#' @export
s_filter = function(.data, ...) {
eval.string.dplyr(.data,"filter", ...)
}
@ramnathv
ramnathv / Makefile
Last active January 16, 2021 13:47
R Markdown to IPython Notebook
example.md: example.Rmd
./knit
example.ipynb: example.md
notedown example.md | sed 's/%%r/%%R/' > example.ipynb
@jimmynotjim
jimmynotjim / more-mute-regex.md
Created July 19, 2012 14:37 — forked from imathis/tweetbot-mute-regex.md
Tweetbot can use regular expressions to mute tweets in your timeline and mentions.

##Simply annoying Tweets

Annoyingly extended words (4+ of the same letter in a phrase): OOOOHHHHMMMMYYYYGGGGOOOODDDD

([a-z])/1{4}

Tweet w/ just a single hashtag: #omgthissucks

^ *#[^ ]+$