Skip to content

Instantly share code, notes, and snippets.

@zekefarwell
zekefarwell / treetest.py
Created May 26, 2020 18:37
Test of tree data structure
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 15:11
Python Import Test Cases
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
# 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}')
<?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: