Skip to content

Instantly share code, notes, and snippets.

View ErikPohl-Lot49-Projects's full-sized avatar
🎯
Focusing

Erik Pohl ErikPohl-Lot49-Projects

🎯
Focusing
  • Boston
View GitHub Profile
@ErikPohl-Lot49-Projects
ErikPohl-Lot49-Projects / code_standards_checklist.csv
Last active December 3, 2018 14:57
Code Standards Checklist
Task Status
Unit tests added for any new development
Build regression tests if they don't already exist
100% passing of regression tests
Meaningful exceptions and exception-handling coverage
Thoughtful & self-documenting variable/property/method and function names
Adequate output to permit users to understand the results and assist in the self-documenting nature of the code
Actual docstring comments at all levels of the code
Linting the code for PEP 8 standardization and other linters
Applying a PEP formatter to the code
@ErikPohl-Lot49-Projects
ErikPohl-Lot49-Projects / Bridge.py
Created November 24, 2018 22:51
Bridge design pattern
"""
Decouple the implementation from its abstract class
so that the abstraction can only be loosely coupled to an otherwise independent implementation
"""
import abc
class dinner_abstraction:
"""
from abc import ABCMeta, abstractmethod
class Chair(object):
def __init__(self, legs=3, material='Wood', color='Oak'):
self.legs = legs
self.material = material
self.color = color
def __str__(self):
@ErikPohl-Lot49-Projects
ErikPohl-Lot49-Projects / project_planning_pattern.csv
Last active November 11, 2018 16:47
Project Planning Pattern
Action Owner Time
Collaborate with all stakeholders and participants on an initial plan PM and team Before the project
Are there any questions or doubts? encourage the team to ask and ask them as PM PM and team Before the project
Encourage this up to project start PM and team Before the project
During the execution record any deviations from plan PM and team During the project
Hold a retrospective review a couple of days later and revise the plan PM and team After the project
Action Owner Action day/time
Build a first checklist before doing a thing Team Before doing a thing
Do the thing using the checklist-- use best judgement when altering the plan and document changes Team While doing a thing
Conduct a retrospective after doing the thing and refine the checklist Team After doing the thing
@ErikPohl-Lot49-Projects
ErikPohl-Lot49-Projects / abstract_factory.py
Last active November 11, 2018 17:47
Abstract Factory
"""
This is an interface to make dependent or logically related objects
without the need up-front to specify the classes
so you can make multiple grouping of classes with this one abstract
factory
"""
import abc
"""
Create one prototypical instance, then create new objects using those instances
"""
import copy
class Kambucha:
"""
This is an example class which is the source and can be copied
@ErikPohl-Lot49-Projects
ErikPohl-Lot49-Projects / ChainOfResponsibility.py
Last active November 11, 2018 17:52
Chain of Responsibility
"""
Class design benefits from decoupling senders of requests from receivers
This pattern allows you to do this by designing a series
"if this doesn't work, try this" objects to handle the request.
The request gets passed along until an object handles it.
"""
import abc
@ErikPohl-Lot49-Projects
ErikPohl-Lot49-Projects / command.py
Last active November 11, 2018 17:56
Command design pattern
"""
Encapsulate a request as an object, thereby letting you parameterize
clients with different requests, queue or log requests, and support
undoable operations.
"""
import abc
class Invoker:
@ErikPohl-Lot49-Projects
ErikPohl-Lot49-Projects / state.py
Last active November 11, 2018 17:59
State Design Pattern
"""
This pattern permits an object to alter its behavior when its internal state changes.
The object will appear to change its class.
"""
import abc
class TrafficLight:
"""