Skip to content

Instantly share code, notes, and snippets.

View timothymillar's full-sized avatar

Tim Millar timothymillar

View GitHub Profile
@brantfaircloth
brantfaircloth / gist:895282
Created March 30, 2011 20:55
Substitution models in mrbayes

##GTR lset applyto=() nst=6 # GTR lset applyto=() nst=6 rates=propinv # GTR + I lset applyto=() nst=6 rates=gamma # GTR + gamma lset applyto=() nst=6 rates=invgamma # GTR + I + gamma

##SYM

lset applyto=() nst=6                           # SYM

prset applyto=() statefreqpr=fixed(equal)

@dashed
dashed / github-pandoc.css
Created September 26, 2013 13:42
GitHub-like CSS for pandoc standalone HTML files (perfect for HTML5 output). Based on Marked.app's GitHub CSS. Added normalize.css (v2.1.3) in the prior to GitHub css.
/*! normalize.css v2.1.3 | MIT License | git.io/normalize */
/* ==========================================================================
HTML5 display definitions
========================================================================== */
/**
* Correct `block` display not defined in IE 8/9.
*/
@dan-blanchard
dan-blanchard / .1.miniconda.md
Last active December 11, 2019 22:38
Quicker Travis builds that rely on numpy and scipy using Miniconda

For ETS's SKLL project, we found out the hard way that Travis-CI's support for numpy and scipy is pretty abysmal. There are pre-installed versions of numpy for some versions of Python, but those are seriously out of date, and scipy is not there are at all. The two most popular approaches for working around this are to (1) build everything from scratch, or (2) use apt-get to install more recent (but still out of date) versions of numpy and scipy. Both of these approaches lead to longer build times, and with the second approach, you still don't have the most recent versions of anything. To circumvent these issues, we've switched to using Miniconda (Anaconda's lightweight cousin) to install everything.

A template for installing a simple Python package that relies on numpy and scipy using Miniconda is provided below. Since it's a common s

@slowkow
slowkow / GTF.py
Last active March 6, 2024 02:05
GTF.py is a simple module for reading GTF and GFF files
#!/usr/bin/env python
"""
GTF.py
Kamil Slowikowski
December 24, 2013
Read GFF/GTF files. Works with gzip compressed files and pandas.
http://useast.ensembl.org/info/website/upload/gff.html
@jjhelmus
jjhelmus / plot_polar_bokeh.py
Created April 14, 2014 02:10
Plotting Polar data with Bokeh
# Plot polar data using Bokeh
# Author: Jonathan J. Helmus
import numpy as np
from bokeh.plotting import *
# Data in polar coordinates
azimuths = np.linspace(0, 2 * np.pi, 20)
ranges = np.array([2, 4, 6, 8])
@subfuzion
subfuzion / global-gitignore.md
Last active July 16, 2024 18:54
Global gitignore

There are certain files created by particular editors, IDEs, operating systems, etc., that do not belong in a repository. But adding system-specific files to the repo's .gitignore is considered a poor practice. This file should only exclude files and directories that are a part of the package that should not be versioned (such as the node_modules directory) as well as files that are generated (and regenerated) as artifacts of a build process.

All other files should be in your own global gitignore file:

  • Create a file called .gitignore in your home directory and add any filepath patterns you want to ignore.
  • Tell git where your global gitignore file is.

Note: The specific name and path you choose aren't important as long as you configure git to find it, as shown below. You could substitute .config/git/ignore for .gitignore in your home directory, if you prefer.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@brendancol
brendancol / rasterio_datashader_polygons.py
Last active December 17, 2020 21:43
Datashader + Rasterio for Polygon shading (40K Polygons, 81M Vertices)
from __future__ import division
from functools import partial
import pyproj
from shapely.ops import transform
import numpy as np
from rasterio import features
from affine import Affine
import fiona
@klmr
klmr / generator.md
Last active August 28, 2022 02:26
Python-like generators in R

A little experiment using restarts.

(And while we’re at it, let’s torture R’s syntax a little.)

![screenshot][]

In the following we will be using R’s “restarts” feature to implement the state machine that drives generators in languages such as Python. Generators allow lazily generating values on demand: a consumer invokes a generator, and consumes values as they are produced. A new value is only produced once the previous one has been consumed.

@aiguofer
aiguofer / README.md
Last active April 27, 2023 19:12
Get info about running jupyter notebooks including memory consumption, how long they've been running, etc.