Skip to content

Instantly share code, notes, and snippets.

Jonathan Chang jonchang

Block or report user

Report or block jonchang

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View brewver.R
#!/usr/bin/env Rscript
req <- jsonlite::fromJSON("")$items
inst <- jsonlite::fromJSON("")$items
req <- req %>% transmute(formula, install_on_request = as.numeric(str_replace_all(count, ",", "")))
inst <- inst %>% transmute(formula, installs = as.numeric(str_replace_all(count, ",", "")))
jonchang / # tig - 2018-07-27_19-14-34.txt
Created Jul 27, 2018
tig on Ubuntu 14.04.5 LTS - Homebrew build logs
View # tig - 2018-07-27_19-14-34.txt
Homebrew build logs for tig on Ubuntu 14.04.5 LTS
Build date: 2018-07-27 19:14:34
jonchang / example.tex
Created Feb 24, 2018
Example LaTeX source for mcexam package
View example.tex
% set fonts
jonchang /
Last active Nov 18, 2017
Unconcatenates a RAxML-style phylip/partitions file
#!/usr/bin/env python3
# By Jonathan Chang - September 2017
import sys, argparse, logging, re, os
def get_partitions(path):
"""Given a path, returns a dictionary with partition names as keys and a list of
length 2, representing a range of characters."""
jonchang / fixes36.0.txt
Created Dec 8, 2015
nethack changes in 3.6.0
View fixes36.0.txt
$NHDT-Branch$:$NHDT-Revision$ $NHDT-Date$
General Fixes and Modified Features
change the dreaded "Stop eating?" to "Continue eating?" with default "no"
setmangry should not be called when a monster enters a bones region
bad capitalization of msg when charging for something that catches light
missing opthelp for use_inverse
Never say "It moves only reluctantly"
expert fireball/cone of cold could not target a monster seen only with
jonchang /
Created Dec 10, 2014
select only certain columns from a tab delimited file (optionally gzipped)
#!/usr/bin/env python
from __future__ import print_function
import gzip
import argparse
from operator import itemgetter
def get_args():
parser = argparse.ArgumentParser(description="selects fields from a tab-delimited file")
jonchang /
Last active Aug 29, 2015
building revbayes w/ homebrew boost

install homebrew...

install dependencies

brew install cmake boost

pull down revbayes development version

jonchang /
Last active Aug 29, 2015
diversitree OS X Mavericks install

Installing diversitree on OS X Mavericks, R 3.1.0

I installed R from the installer on CRAN

If you installed R from the installer on CRAN:

The easy way

Download my compiled package from Dropbox and install it that way:

jonchang / shrimp.rb
Last active Dec 28, 2015
Binary-only install of SHRiMP
View shrimp.rb
require 'formula'
class Shrimp < Formula
homepage ''
url ''
sha1 'ba666ccc0aa5da0f55a8a41e6f40daabe876c3dd'
version '2.2.2'
def patches
# Change shebang of Python utilities.
jonchang /
Created Sep 7, 2013
Python utility function: Given a path tries to parse a FASTA file. Returns an iterator which yields a (name, sequence) tuple
def parse_fasta(path):
"""Given a path tries to parse a fasta file. Returns an iterator which
yields a (name, sequence) tuple"""
with open(path) as handle:
name = sequence = ""
for line in handle:
line = line.strip()
if line.startswith(">"):
if name:
yield name, sequence
You can’t perform that action at this time.