Skip to content

Instantly share code, notes, and snippets.

View charlesreid1's full-sized avatar
💭
🍒 🍍 🍓 🍊 🍌

Chaz Reid charlesreid1

💭
🍒 🍍 🍓 🍊 🍌
View GitHub Profile
@charlesreid1
charlesreid1 / get_all_bundles.py
Last active October 22, 2019 16:26
output from DSSClient.get_bundles_all()
import json
from hca.dss import DSSClient
dss = DSSClient()
print(dss.get_all_bundles(replica="gcp"))
print(dss.get_all_bundles(replica="aws"))
@charlesreid1
charlesreid1 / simple_arg.py
Created July 23, 2019 22:28
A very simple argparse example. Takes one argument, a path to a folder (-d or --dir); prints whether that folder exists.
import os, sys
import argparse
"""
A Simple Argparse Program
That Works Just The Way
We Like It.
Charles Reid
@charlesreid1
charlesreid1 / example_hyperas.ipynb
Created May 20, 2019 20:53
example_hyperas.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@charlesreid1
charlesreid1 / poly_circ_undirected.tex
Created March 17, 2019 23:08
TeX for drawing circles with inscribed polygons and labeled vertices, for the Josephus problem.
\documentclass[border=2mm]{standalone}
\usepackage{tikz}
\usepackage{xintexpr}
\usetikzlibrary{shapes.geometric}
\begin{document}
\begin{tikzpicture}[scale=3]
% make a node with variable name pol (with the list of features given) at the location (0,0), and don't label it
\node (pol) [draw=none, thick, black!90!black,rotate=0,minimum size=6cm,regular polygon, regular polygon sides=11] at (0,0) {};
@charlesreid1
charlesreid1 / poly_directed.tex
Last active March 17, 2019 20:41
TeX for drawing labeled polygons with directed and undirected paths (for illustrating solutions to the Josephus problem).
\documentclass[border=2mm]{standalone}
\usepackage{tikz}
\usepackage{xintexpr}
\usetikzlibrary{shapes.geometric}
\begin{document}
\begin{tikzpicture}[scale=3]
% make a node with variable name pol (with the list of features given) at the location (0,0), and don't label it
\node (pol) [draw, thick, black!90!black,rotate=0,minimum size=6cm,regular polygon, regular polygon sides=11] at (0,0) {};
@charlesreid1
charlesreid1 / polygon.tex
Last active March 17, 2019 20:40
TeX for drawing labeled polygons (for illustrating solutions to the Josephus problem).
\documentclass[border=2mm]{standalone}
\usepackage{tikz}
\usepackage{xintexpr}
\usetikzlibrary{shapes.geometric}
\begin{document}
\begin{tikzpicture}[scale=3]
% make a node with variable name pol (with the list of features given) at the location (0,0), and don't label it
\node (pol) [draw, thick, black!90!black,rotate=0,minimum size=6cm,regular polygon, regular polygon sides=11] at (0,0) {};
@charlesreid1
charlesreid1 / make_centillion_public.py
Last active March 4, 2019 16:46
Centillion Dead Person Switch: If this script is run for more than 72 hours continuously, it will make the dcppc/centillion repository public.
#!/usr/bin/env python
import re, os
from github import Github
import time
'''
Centillion Dead Person Switch
If this script is run for
more than 72 hours continuously,
@charlesreid1
charlesreid1 / README.md
Last active March 4, 2019 05:20
Walk through each issue in a Github repository and extract the date that each issue was closed.

Walk a Github Repo

This uses the Github API, via the PyGithub Python library, to list all closed issues and print info about when the issue was closed and who closed it.

To run, you need a Github API access token:

GITHUB_TOKEN="XXX" python issue_close_dates.py
@charlesreid1
charlesreid1 / germlife.md
Last active February 6, 2019 07:07
The Story of Germ Life, Chapter 1 - Markdown format

THE STORY OF GERM LIFE: CHAPTER I: BACTERIA AS PLANTS

During the last fifteen years the subject of bacteriology has developed with a marvellous rapidity. At the beginning of the...

HISTORICAL.

The study of bacteria practically began with the use of the microscope. It was toward the close of the seventeenth century that...

Nothing of importance came from this work, however, partly because of the inadequacy of the microscopes of the day, and...

@charlesreid1
charlesreid1 / wraps.py
Last active February 6, 2019 02:33
Using functools @wraps
from functools import wraps
'''
This is a brief demo of how and why
functools @wraps is useful.
Basically, the decorator invisibly
swaps out one function with another
wrapper function. Unfortunately it
also invisibly swaps out the __name__