Skip to content

Instantly share code, notes, and snippets.

Avatar

Anthony Kong kongakong

  • Sydney, Australia
View GitHub Profile
@kongakong
kongakong / get_rules.py
Created Apr 23, 2018
Print out page rules on Cloudflare
View get_rules.py
import requests
import pprint
import os
TOKEN=os.environ['TOKEN']
ZONE=os.environ['ZONE']
EMAIL="your email"
def get_all_rules():
View GrowingPacker in coffeescript
define (require) ->
# blocks = [
# { w: 100, h: 100 },
# { w: 100, h: 100 },
# { w: 80, h: 80 },
# { w: 80, h: 80 }
# ];
# packer = new GrowingPacker()
View Simple test of trapping TERM signal in python
import signal
def docker_shutdown_handler(_signum, _frame):
print("Get TERM'd")
print("Register a signal handler")
signal.signal(signal.SIGTERM, docker_shutdown_handler)