This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"\e[A": history-search-backward | |
"\e[B": history-search-forward | |
set show-all-if-ambiguous on | |
set completion-ignore-case on |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
license: gpl-3.0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Python 2.7: | |
from io import BytesIO | |
def get_dumpdata_results(self): | |
# https://stackoverflow.com/questions/16075789/how-to-use-call-command-with-dumpdata-command-to-save-json-to-file#16076115 | |
buf = BytesIO() | |
management.call_command('dumpdata', stdout=buf) | |
buf.seek(0) | |
return json.loads(buf.read()) | |
# Python 3.6 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
In [10]: timeit.timeit("json.dumps(cmm_sig, separators=(',', ':'))", setup='from zapprx.utils import signatureConverter as s; cmm_sig = s.signaturePad_to_cmm(s.in_sig); import json', number=10000) | |
Out[10]: 0.5381269454956055 | |
In [11]: timeit.timeit("'[{}]'.format(','.join(['[{},{},{}]'.format(l[0], l[1], l[2]) for l in cmm_sig]))", setup='from zapprx.utils import signatureConverter as s; cmm_sig = s.signaturePad_to_cmm(s.in_sig)', number=10000) | |
Out[11]: 0.8120849132537842 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import re | |
import sys | |
from tempfile import mkstemp | |
from shutil import move | |
from os import remove | |
def convert(source_file_path): | |
fh, target_file_path = mkstemp() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(zve)danner@mac:~/ZappRx/services$ pip install pydocusign | |
Collecting pydocusign | |
Using cached pydocusign-0.12.zip | |
Collecting beautifulsoup4 (from pydocusign) | |
Using cached beautifulsoup4-4.3.2.tar.gz | |
Collecting certifi (from pydocusign) | |
Using cached certifi-14.05.14.tar.gz | |
/Users/danner/ZappRx/services/zve/lib/python2.7/site-packages/setuptools/dist.py:284: UserWarning: The version specified requires normalization, consider using '14.5.14' instead of '14.05.14'. | |
self.metadata.version, | |
Requirement already satisfied (use --upgrade to upgrade): python-dateutil in ./zve/lib/python2.7/site-packages (from pydocusign) |