Intent:
- Increase awareness of architectural best practices
'Emulate max() as fully as possible in pure Python.' | |
# https://stackoverflow.com/questions/69997857/implementation-of-max-function-in-python/69997876#69997876 | |
# https://github.com/python/mypy/issues/7231 | |
from typing import TypeVar, Any, Iterator, Iterable, Optional | |
from typing import Union, Protocol, Callable, cast, Tuple, overload | |
class SupportsGT(Protocol): |
# vehicle.py | |
from collections import namedtuple | |
class Vehicle: | |
def __init__(self, name, veh_type): | |
self.name = name | |
self.veh_type = veh_type | |
self.add_ons = [] | |
#!/bin/sh | |
# | |
# Title: Auto-Update & Upload LetsEncrypt Certs to KEMP LoadMaster | |
# Guide/Source: https://colinwilson.uk/2017/06/19/auto-update-ssl-certificates-on-kemp-loadmaster-via-pfsense--lets-encrypt/ | |
# Created: 12/06/2017 | |
# Author: Colin Wilson @colinwilson | |
# Vendor or Software Link: https://www.pfsense.org/ , https://kemptechnologies.com | |
# Version: 1.1.0 | |
# Category: BASH Shell Script |
#!/usr/bin/env python | |
""" | |
Written by Nathan Prziborowski | |
Github: https://github.com/prziborowski | |
This code is released under the terms of the Apache 2 | |
http://www.apache.org/licenses/LICENSE-2.0.html | |
The property collector can be used to fetch a subset of properties | |
for a large amount of objects with fewer round trips that iterating. | |
This sample shows how to use the TraversalSpec to get properties | |
of another object without multiple calls. |
''' | |
You'll need to pip install some dependencies: | |
* python-dateutil | |
* requests | |
Also, populate your EMAIL and PASSWORD below. | |
''' | |
from xml.etree import ElementTree |
Markdown Preview Enhanced supports rendering flow charts
, sequence diagrams
, mermaid
, PlantUML
, WaveDrom
, GraphViz
, Vega & Vega-lite
, Ditaa
diagrams.
You can also render TikZ
, Python Matplotlib
, Plotly
and all sorts of other graphs and diagrams by using Code Chunk.
Please note that some diagrams don't work well with file exports such as PDF, pandoc, etc.
This feature is powered by flowchart.js.
#!/bin/sh | |
# | |
# Title: Auto-Update & Upload LetsEncrypt Certs to KEMP LoadMaster | |
# Guide/Source: https://colinwilson.uk/2017/06/19/auto-update-ssl-certificates-on-kemp-loadmaster-via-pfsense--lets-encrypt/ | |
# Created: 12/06/2017 | |
# Author: Colin Wilson @colinwilson | |
# Vendor or Software Link: https://www.pfsense.org/ , https://kemptechnologies.com | |
# Version: 1.1.0 | |
# Category: BASH Shell Script |