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
| git+ssh://git@github.com/user/repo.git@branch |
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
| function* enumerate(array) | |
| { | |
| /** | |
| * Duplicates the functionality of Python's enumerate function. | |
| * | |
| * Return, for each element of 'array' an array the element's index and the element. | |
| * | |
| * e.g. | |
| * | |
| * [i, elem] |
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
| function getObjectPaths(object, parentalPath="", delimiter=".") | |
| { | |
| let paths = []; | |
| for (const [key, value] of Object.entries(object)) | |
| { | |
| const pathComponents = []; | |
| // If 'parentalPath' doesn't indicate the root of the tree... | |
| if (parentalPath.length > 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
| writing-mode: vertical-rl; | |
| text-orientation: upright; | |
| margin-left: auto; | |
| margin-right: auto; | |
| /* Add vertical-align: middle to <td> */ |
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 logging | |
| import sys | |
| # Use this format for more verbosity | |
| LOGGING_FORMAT = "%(asctime)s - %(name)s - %(levelname)s - %(message)s" | |
| logger = logging.getLogger() | |
| logger.setLevel(logging.DEBUG) | |
| handler = logging.StreamHandler(stream=sys.stdout) |
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
| class ClassInstanceCacher(object): | |
| # Rename the outer class at will. | |
| # Implement Klass to suit use case | |
| __cache = {} | |
| def __new__(cls, _id): | |
| if cls.__cache.get(_id) is None: | |
| cls.__cache[_id] = cls.Klass(_id) | |
| return cls.__cache[_id] |
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
| ^(?!development|master).*$ |
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
| [tox] | |
| envlist = py27 | |
| [testenv] | |
| install_command=pip install --extra-index-url=http://pypi.ad.cleversafe.com/simple/ --trusted-host=pypi.ad.cleversafe.com {opts} {packages} | |
| # Allows running e.g. `tox -e DCC` | |
| # Otherwise include commands in [testenv] | |
| # NOTE: -s can be run pointed at a directory and it will run all modules inside | |
| [testenv:DCC] |
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
| Source: https://github.com/transloadit/python-sdk/issues/4 | |
| 1. Uninstall pycurl | |
| 2. brew install openssl (May already be installed...) | |
| 3. export CPPFLAGS=-I/usr/local/opt/openssl/include | |
| 4. export LDFLAGS=-L/usr/local/opt/openssl/lib | |
| 5. pip install pycurl --global-option="--with-openssl" | |
| 6. Rejoice |
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
| def get_dict_path(dict_, path, default=None): | |
| if len(path) < 1: | |
| return dict_ | |
| return get_dict_path(dict_.get(path[0], default), path[1:], default) |