Skip to content

Instantly share code, notes, and snippets.

View martyni's full-sized avatar

Martyn Pratt martyni

View GitHub Profile
@martyni
martyni / bashy shark
Created July 24, 2019 10:59
baby shark one liner
for shark in baby mommy daddy grandma grandpa; do for i in {1..3}; do echo $shark shark; for do in do doo do do do do; do echo $do ;done; done; echo $shark shark ;done;
---
AWSTemplateFormatVersion: '2010-09-09'
Description: The AWS CloudFormation template for Kinesis Stream
Parameters:
Environment:
Description: dev, stage, or prod - this is for bucket tags
Type: String
MinLength: '3'
MaxLength: '5'
Resources:
@martyni
martyni / my_module.py
Last active May 22, 2019 15:34
example of patch and how it can alter functions for use in tests
from my_other_module import function_4
def function_1():
return 1
def function_2():
return_tuple = (function_1(), function_3(), function_4())
return return_tuple
def function_3():
@martyni
martyni / pointless.py
Last active May 17, 2019 10:44
Pointlessly complicated python class
class Pointless_Class():
def __init__(self, this=None, that=None, the_other=None):
self.this = this or not this
self.that = that or not this if this is False else the_other
self.the_other = the_other if self.this is self.that else 'Screw this...!'
if __name__ == "__main__":
my_pointless_class = Pointless_Class()
print("this is {}".format( my_pointless_class.this ))
print("that is {}".format( my_pointless_class.that ))
automatic hair dresser