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
// This is based on original code from http://stackoverflow.com/a/22649803 | |
// with special credit to error454's Python adaptation: https://gist.github.com/error454/6b94c46d1f7512ffe5ee | |
function EnhanceColor(normalized) { | |
if (normalized > 0.04045) { | |
return Math.pow( (normalized + 0.055) / (1.0 + 0.055), 2.4); | |
} | |
else { return normalized / 12.92; } | |
} |
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
from sshtunnel import SSHTunnelForwarder | |
from sqlalchemy import create_engine | |
from sqlalchemy.orm import sessionmaker | |
from functools import wraps | |
# secrets.py contains credentials, etc. | |
import secrets | |
def get_engine_for_port(port): | |
return create_engine('postgresql://{user}:{password}@{host}:{port}/{db}'.format( |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.