Skip to content

Instantly share code, notes, and snippets.

View marcia's full-sized avatar

Marcia Lee marcia

View GitHub Profile
@marcia
marcia / gist:7018719
Last active December 25, 2015 18:09
Implementing color palettes with LESS mixins
// List out each domain's colors theme
@mathDomainColor: #297395; // The dark blue
@mathSubjectColor: #30a7de; // The lighter blue
... more colors ...
@scienceDomainColor: #ba3d66; // The dark pink
@scienceSubjectColor: #c8547c; // The lighter pink
... more colors ...
// Here's a mixin that will call .domainRuleToApply on each domain for us
@marcia
marcia / gist:6695509
Created September 25, 2013 05:33
how does a db object reference an ndb object in app engine?
class NdbKeyProperty(db.Property):
"""Stores an ndb key in a db model."""
def get_value_for_datastore(self, model_instance):
value = super(NdbKeyProperty, self).get_value_for_datastore(
model_instance)
if value is None:
return value
# We were given an ndb key, and we want to store it as a db key
return value.to_old_key()