Skip to content

Instantly share code, notes, and snippets.

View JasonKessler's full-sized avatar

Jason S. Kessler JasonKessler

View GitHub Profile
### Keybase proof
I hereby claim:
* I am jasonkessler on github.
* I am jasonkessler (https://keybase.io/jasonkessler) on keybase.
* I have a public key ASCPvUWxdEZQwSzjQWQxLIxn9xolt5fWO6Tr2SFQ-_tsEAo
To claim this, I am signing this object:
@JasonKessler
JasonKessler / gist:8563282fcedf010bc809e24f647b780b
Last active February 4, 2017 01:31
Apache combined logging format for Flask/Python3 (poorly hacked together and someone incomplete)
def apache_combined_log(request: flask.request):
path = request.path
if len(request.query_string) > 0:
path += '?' + request.query_string.decode('utf-8')
size = '-'
if request.__sizeof__() > 0:
size = request.__sizeof__()
referrer = '-'
if request.referrer:
referrer = request.referrer
@JasonKessler
JasonKessler / monkey_patch_keras_custom_object.py
Last active January 19, 2017 23:12
Loading a model with custom activation function (or custom_objects) in Keras 1.1.0 via monkey patching
import mock, keras
def custom(x):
return x # Replace this with your activation function.
model_json = open('config.json').read()
'''
Trying to run: