Skip to content

Instantly share code, notes, and snippets.

View Ryanb58's full-sized avatar

Taylor Brazelton Ryanb58

View GitHub Profile
@Ryanb58
Ryanb58 / Output
Created May 16, 2017 16:16 — forked from DazWorrall/Output
Testing file upload handling in Flask
in upload handler
in file close
..
----------------------------------------------------------------------
Ran 2 tests in 0.021s
OK
@Ryanb58
Ryanb58 / curl.example
Created October 4, 2016 15:05 — forked from schovi/curl.example
How to use httpie instal of curl with elasticsearch
$ curl -XPUT 'http://localhost:9200/twitter/' -d '{
index : {
number_of_shards : 3
number_of_replicas : 2
}
}'
@Ryanb58
Ryanb58 / delayedinterrupt.py
Created April 20, 2016 22:58 — forked from tcwalther/delayedinterrupt.py
DelayedInterrupt class - delaying the handling of process signals in Python
import signal
import logging
# class based on: http://stackoverflow.com/a/21919644/487556
class DelayedInterrupt(object):
def __init__(self, signals):
if not isinstance(signals, list) and not isinstance(signals, tuple):
signals = [signals]
self.sigs = signals