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
// Last Sync timestamp mixin. Works for Models and Collections. | |
var LastSync = { | |
// Update lastSync with current timestamp. | |
_timestampSync: function() { | |
this.lastSync = new Date(); | |
}, | |
// Note: Call LastSync.initialize.apply(this) from the Model/Collection .initialize. | |
initialize: function() { | |
// Setup lastSync to timestamp sync events. | |
this.lastSync = null; |
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
/** | |
* Usage: | |
* var MyRouter = Backbone.Router.extend(_.extend({}, OptionalRouteMixin, { | |
* userRoutes: { | |
* '/profile': 'profile' | |
* }, | |
* initialize: function(options) { | |
* this._bindOptRoutes(this.userRoutes); | |
* } | |
* })); |
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
#!/usr/bin/env python | |
""" | |
AppStats serializer module which converts App Engine profile data from Protocol Buffers into JSON. | |
Usage: | |
import appstats_serializer | |
# List all AppStats summaries: | |
appstats_dicts = appstats_serializer.appstats_to_dict(summaries_only=True) |
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
#!/usr/bin/env python | |
""" | |
JSON encoder/decoder adapted for use with Google App Engine NDB. | |
Usage: | |
import ndb_json | |
# Serialize an ndb.Query into an array of JSON objects. | |
query = models.MyModel.query() |
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
.line { | |
fill: none; | |
stroke: lightblue; | |
stroke-width: 1.5px; | |
stroke-linecap: butt; | |
shape-rendering: geometricPrecision ; | |
} | |
.axis--x text { | |
} |
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
.box { | |
font: 10px sans-serif; | |
} | |
.box line, | |
.box rect, | |
.box circle { | |
fill: #fff; | |
stroke: #000; | |
stroke-width: 1.5px; |
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
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
""" | |
Create automatic versions of your App Engine Datastore Models, allowing you to undo changes! | |
Usage: | |
import gae_ndb_revisions | |
# Add two properties to your Model(s). |
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
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
""" | |
Search-augmented NDB Models for Google App Engine. | |
Usage: | |
import search_models | |
# Define an index for the document type. |
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
#!/usr/bin/env python | |
""" | |
Setup a virtualenv with the Google App Engine SDK. | |
References: | |
http://virtualenv.readthedocs.org/en/latest/virtualenv.html#creating-your-own-bootstrap-scripts | |
http://mindtrove.info/virtualenv-bootstrapping/ | |
""" | |
import hashlib | |
import os |
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
# https://gist.github.com/erichiggins/a8bcd07295597d91dea7/ | |
# version: 0.1.0 | |
# author: Eric Higgins <erichiggins@gmail.com> | |
# | |
# Installation: | |
# | |
# 1) Copy this file into your repo's directory. | |
# cp docker_passthru.bash.inc ~/src/myrepo/ | |
# 2) Add the following to your ~/.bash_profile to include this script. | |
# source ~/src/myrepo/docker_passthru.bash.inc |
OlderNewer