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
library(tidyverse)
req <- jsonlite::fromJSON("https://formulae.brew.sh/api/analytics/install-on-request/30d.json")$items
inst <- jsonlite::fromJSON("https://formulae.brew.sh/api/analytics/install/30d.json")$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
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
jonchang / example.tex
Created Feb 24, 2018
Example LaTeX source for mcexam package
View example.tex
\documentclass[twoside]{article}
\usepackage[english]{babel}
% set fonts
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{mathpazo}
\usepackage{microtype}
\usepackage{etoolbox}
@jonchang
jonchang / unconcatenate_phylip.py
Last active Nov 18, 2017
Unconcatenates a RAxML-style phylip/partitions file
View unconcatenate_phylip.py
#!/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
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
jonchang / streaming_select_cols.py
Created Dec 10, 2014
select only certain columns from a tab delimited file (optionally gzipped)
View streaming_select_cols.py
#!/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
jonchang / instructions.md
Last active Aug 29, 2015
building revbayes w/ homebrew boost
View instructions.md

install homebrew... http://brew.sh

install dependencies

brew install cmake boost

pull down revbayes development version

@jonchang
jonchang / instructions.md
Last active Aug 29, 2015
diversitree OS X Mavericks install
View instructions.md

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
jonchang / shrimp.rb
Last active Dec 28, 2015
Binary-only install of SHRiMP
View shrimp.rb
require 'formula'
class Shrimp < Formula
homepage 'http://compbio.cs.toronto.edu/shrimp/'
url 'http://compbio.cs.toronto.edu/shrimp/releases/SHRiMP_2_2_2.macosx.x86_64.tar.gz'
sha1 'ba666ccc0aa5da0f55a8a41e6f40daabe876c3dd'
version '2.2.2'
def patches
# Change shebang of Python utilities.
@jonchang
jonchang / parse_fasta.py
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
View parse_fasta.py
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.