Skip to content

Instantly share code, notes, and snippets.

@zekefarwell
zekefarwell / treetest.py
Created May 26, 2020
Test of tree data structure
View treetest.py
import json
class NestedDict(dict):
def __getitem__(self, key):
if key not in self:
return self.setdefault(key, NestedDict())
return self.get(key)
@zekefarwell
zekefarwell / logger.py
Created May 1, 2020
Python Import Test Cases
View logger.py
from __future__ import annotations
import thing as t
class Logger:
# This type hint would throw a circular error because
# without the __future__ import above.
# That import defers the execution of the typehint until after
# thing is fully initialized
View argtest.py
# Didn't know this worked
def fullname(first, middle, last):
print(f'{first} {middle} {last}')
fullname(last="Farwell", first='Ezekiel', middle="Boyle-O'Reilly")
# Definitely didn't know this worked!
def fullnamekw(first='First', middle='Middle', last='Last'):
print(f'{first} {middle} {last}')
View SupportDesk_FixAcl.php
<?php
/**
* SupportDesk_FixAcl.php v1.1
* SupportDesk (www.supportdesk.nu)
* 10/7/2015
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 3.0)
* It is available through the world-wide-web at this URL: