Skip to content

Instantly share code, notes, and snippets.

💭
🍒 🍍 🍓 🍊 🍌

Chaz Reid charlesreid1

💭
🍒 🍍 🍓 🍊 🍌
Block or report user

Report or block charlesreid1

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
@charlesreid1
charlesreid1 / get_all_bundles.py
Last active Oct 22, 2019
output from DSSClient.get_bundles_all()
View get_all_bundles.py
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 Jul 23, 2019
A very simple argparse example. Takes one argument, a path to a folder (-d or --dir); prints whether that folder exists.
View simple_arg.py
import os, sys
import argparse
"""
A Simple Argparse Program
That Works Just The Way
We Like It.
Charles Reid
View 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 Mar 17, 2019
TeX for drawing circles with inscribed polygons and labeled vertices, for the Josephus problem.
View poly_circ_undirected.tex
\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 Mar 17, 2019
TeX for drawing labeled polygons with directed and undirected paths (for illustrating solutions to the Josephus problem).
View poly_directed.tex
\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 Mar 17, 2019
TeX for drawing labeled polygons (for illustrating solutions to the Josephus problem).
View polygon.tex
\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 Mar 4, 2019
Centillion Dead Person Switch: If this script is run for more than 72 hours continuously, it will make the dcppc/centillion repository public.
View make_centillion_public.py
#!/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 / process.py
Last active Feb 25, 2019
Example Jinja template for yaml config files
View process.py
from jinja2 import Environment, PackageLoader, select_autoescape
def process(**kwargs):
# set up Jinja env
env = Environment(
loader=PackageLoader(''),
autoescape=select_autoescape(['html', 'xml'])
)
@charlesreid1
charlesreid1 / germlife.md
Last active Feb 6, 2019
The Story of Germ Life, Chapter 1 - Markdown format
View germlife.md

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...

View wraps.py
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__
You can’t perform that action at this time.