Skip to content

Instantly share code, notes, and snippets.

View mikegilchrist's full-sized avatar

Michael A Gilchrist mikegilchrist

  • University of Tennessee
  • Knoxville, TN USA
View GitHub Profile
@mikegilchrist
mikegilchrist / coord_cartesian_panels.R
Created January 12, 2022 21:09 — forked from r2evans/coord_cartesian_panels.R
per-facet panel range clipping
#' Cartesian coordinates per facet-panel
#'
#' This function mimics the behavior of [ggplot2::coord_cartesian()],
#' while supporting per-panel limits when faceted.
#'
#' @details
#'
#' A 'panel_limits' data frame may contain:
#'
#' - zero or more faceting variables, all of which must be found
@mikegilchrist
mikegilchrist / mbox_to_overview_folder.py
Created October 18, 2021 15:53 — forked from adamhooper/mbox_to_overview_folder.py
Convert an mbox file into a folder full of .txt and attachments. Good for uploading ~1,000 messages to Overview.
#!/usr/bin/env python3
import email.message
import mailbox
# Just ignore these lines.
# Python's mbox reader finds a way to return Messages that don't
# have these super-important methods. This hack adds them.
setattr(email.message.Message, '_find_body', email.message.MIMEPart._find_body)
setattr(email.message.Message, '_body_types', email.message.MIMEPart._body_types)