Skip to content

Instantly share code, notes, and snippets.

View kongakong's full-sized avatar

Anthony Kong kongakong

  • Sydney, Australia
View GitHub Profile
@kongakong
kongakong / gist:df4863ae134aeb6a954e00143ac8d89e
Last active April 25, 2021 05:52
Concurrent conversion of video files with ffmpeg
#!/usr/bin/env python3
import os
import sys
import subprocess
import datetime
import time
from multiprocessing import Pool
def convert_to_iso_mp4(params):
@kongakong
kongakong / get_rules.py
Created April 23, 2018 22:56
Print out page rules on Cloudflare
import requests
import pprint
import os
TOKEN=os.environ['TOKEN']
ZONE=os.environ['ZONE']
EMAIL="your email"
def get_all_rules():
define (require) ->
# blocks = [
# { w: 100, h: 100 },
# { w: 100, h: 100 },
# { w: 80, h: 80 },
# { w: 80, h: 80 }
# ];
# packer = new GrowingPacker()
import signal
def docker_shutdown_handler(_signum, _frame):
print("Get TERM'd")
print("Register a signal handler")
signal.signal(signal.SIGTERM, docker_shutdown_handler)