Skip to content

Instantly share code, notes, and snippets.

View DavidCain's full-sized avatar

David Cain DavidCain

View GitHub Profile
@DavidCain
DavidCain / affiliation_stats.py
Created February 24, 2017 00:45
Winter School participation by MIT affiliation and student status
"""
Gather affiliation statistic from this year's Winter School
"""
from collections import Counter, OrderedDict
import csv
from ws import models
from ws.utils import dates as dateutils
@DavidCain
DavidCain / past_year_stats.py
Last active March 22, 2017 23:48
MITOC trip participation over the past year
"""
Gather some basic statistics about trips in the past year.
"""
from __future__ import print_function
from collections import Counter, OrderedDict
from datetime import timedelta
from ws import models
from ws.utils import dates as dateutils
@DavidCain
DavidCain / publish_private_repo.sh
Created April 6, 2018 00:50
Publish a private repository, with a sensitive file removed
# Publish a private repository to a publically-viewable repo, with one private file totally purged
#
# Takes extreme precaution to purge all objects & references with sensitive data
export REPO_PATH='/tmp/staging-repository' # Where our temporary repo lives
export PRIVATE_REPO='[email protected]:mitoc/mitoc-ansible.git' # Private repo with sensitive data
export PUBLIC_REPO='[email protected]:DavidCain/mitoc-ansible.git' # Repo viewable to the world
export SENSITIVE_FILE='env_vars/production.yml' # File to be omitted from history