Skip to content

Instantly share code, notes, and snippets.

View ashcrow's full-sized avatar
😎

Stephen Milner ashcrow

😎
View GitHub Profile
@ashcrow
ashcrow / ansible-doc.py
Created May 22, 2017 16:50
POC of documentation
#!/usr/bin/env python3
"""
Super simple POC
"""
import sys
import markdown
import yaml
filename = sys.argv[1]
@ashcrow
ashcrow / install_systemcontainer.yaml
Created April 3, 2017 14:59
Prototype System Container Ansible
# Copyright (C) 2016-2017 Red Hat, Inc
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
@ashcrow
ashcrow / pylint_type.py
Created March 20, 2017 19:15
Example of pylint seing something not promised as a list
import json
class A:
def __init__(self):
self.b = None
@property
def a(self):
if self.b is None:

This is an example of loading code and dynamically creating a class based on the version requested.

Structure

project/init.py # in gist project/client/init.py # EMPTY project/client/v1_test.py # in gist project/client/v2_test.py # in gist

@ashcrow
ashcrow / __init__.py
Created February 6, 2017 20:45
In project
import os # for listing files
import sys # for finding current location
import importlib # Used to dynamically import modules
# object subclasses for 2.x support
# Path to the importable code. This is important when loading
# code from a directory. We need to know where the files will be located.
MODULE_PATH = os.path.sep.join([
os.path.dirname(os.path.abspath(
@ashcrow
ashcrow / argdoc.py
Created January 20, 2017 16:53
argdoc example
#!/usr/bin/env python
import inspect
import re
#: Regex that finds exception raising
RAISE_RX = re.compile('raise ([^\(]*)\(')
def test(a, b='ok', c=False):
if False:
@ashcrow
ashcrow / commissaire-2017-01-09-agenda.md
Last active January 9, 2017 14:07
Agenda for 2017-01-9

Commissaire Agenda: 2017-01-09

Chair: ashcrow

Presentations

@ashcrow
ashcrow / gist:2f67f04057eaedb0582b15734f0c93a1
Created January 5, 2017 16:01
commissaire-vagrant-pip
[vagrant@commissaire ~]$ . commissaire_env/bin/activate
(commissaire_env) [vagrant@commissaire ~]$ pip --version
pip 9.0.1 from /home/vagrant/commissaire_env/lib/python3.5/site-packages (python 3.5)
07:37:54 ashcrow- | Let's go ahead and get started
07:37:58 ashcrow- | Agenda Item 1: Presentations
07:38:03 ashcrow- | None this week
07:38:32 ashcrow- | Agenda Item 2: Open PR Discussions
07:38:48 ashcrow- | We actually have all outstanding PRs merged as of Friday :-D
07:38:54 ashcrow- | commissaire: 7 merged
07:38:54 ashcrow- | commissaire-http: 2 merged
07:38:54 ashcrow- | commissaire-service: 4 merged
07:39:05 ashcrow- | a few of them were big PRs
07:39:20 ashcrow- | Highlights from this past 2 weeks include:
@ashcrow
ashcrow / commissaire-2016-12-12-agenda.md
Last active December 12, 2016 12:47
Agenda for 2016-12-12