This file contains 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
# app is flask app object | |
class FlaskAppFormatter(logging.Formatter): | |
def format(self, record): | |
if record.pathname and record.pathname.startswith(app.root_path): | |
record.pathname = record.pathname.lstrip(app.root_path) | |
return super(FlaskAppFormatter, self).format(record) |
This file contains 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
# Original file https://github.com/jimmyho/satellizer/blob/master/examples/server/python/app.py | |
from sqlalchemy.ext.hybrid import hybrid_property | |
class User(db.Model): | |
_password = db.Column('password', db.String(120)) | |
# ... etc ... | |
@hybrid_property |
This file contains 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
// Add percentage of white to a color | |
@function tint($color, $percent){ | |
@return mix(white, $color, $percent); | |
} | |
// Add percentage of black to a color | |
@function shade($color, $percent){ | |
@return mix(black, $color, $percent); | |
} |
This file contains 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
/** | |
* Responsive mixin. The media breakpoints are as defined | |
* in the twitter bootstrap framework: | |
* | |
* - phone | |
* - tablet-portrait | |
* - tablet-landscape-desktop | |
* - large-desktop | |
* | |
* Additional parameters for tagetting retina and non-retina |
This file contains 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
# turn dict into an object that allows access to nested keys via dot notation | |
# from http://stackoverflow.com/questions/3797957/python-easily-access-deeply-nested-dict-get-and-set | |
# made three modifications: | |
# --added `get()` method | |
# --added `if not dict.__contains__...` to `__contains__()` | |
# --can now accept None as key | |
# JHO: | |
# --updated prints and Exceptions to be python3 friendly | |
# https://gist.github.com/einnocent/8854896 | |
class dotdictify(dict): |
This file contains 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
'use strict'; | |
/** | |
* This module monitors angularFire's authentication and performs actions based on authentication state. | |
* directives/directive.ngcloakauth.js depends on this file | |
* | |
* Modify ng-cloak to hide content until FirebaseSimpleLogin resolves. Also | |
* provides ng-show-auth methods for displaying content only when certain login | |
* states are active. | |
* |
NewerOlder