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 ferris3 | |
| import endpoints | |
| import protopigeon | |
| from protorpc import messages | |
| from google.appengine.ext import ndb | |
| class ExampleProperty(ndb.StringProperty): | |
| def _to_base_type(self, value): | |
| return "---" + str(value) + "---" |
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 subprocess | |
| import json | |
| import argparse | |
| import random | |
| import string | |
| PROJECT = None | |
| REGION = 'us-central1' | |
| ZONE = 'us-central1-f' |
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 ferris3 | |
| from google.appengine.ext import ndb | |
| class Todo(ndb.Model): | |
| text = ndb.StringProperty(default='', indexed=False) | |
| done = ndb.BooleanProperty(default=False) | |
| created = ndb.DateTimeProperty(auto_now_add=True) | |
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 ferris3 | |
| from google.appengine.ext import ndb | |
| class Todo(ndb.Model): | |
| text = ndb.StringProperty(default='', indexed=False) | |
| done = ndb.BooleanProperty(default=False) | |
| created = ndb.DateTimeProperty(auto_now_add=True) | |
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
| # Dockerfile extending the generic Python image with application files for a | |
| # single application. | |
| FROM google/appengine-python27 | |
| ADD requirements.txt /app/ | |
| RUN pip install -r requirements.txt | |
| ADD . /app |
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
| application: your-app-id | |
| version: 1 | |
| runtime: python27 | |
| threadsafe: true | |
| api_version: 1 | |
| module: api | |
| handlers: | |
| # Endpoints handler | |
| - url: /_ah/spi/.* |
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_config | |
| if __name__ == '__main__': | |
| try: | |
| do_stuff() | |
| except Exception as e: | |
| logging.exception(e) | |
| raise |
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 raven.handlers.logging import SentryHandler | |
| from raven.conf import setup_logging | |
| import logging | |
| handler = SentryHandler('sentry dsn here') | |
| setup_logging(handler) | |
| console = logging.StreamHandler() | |
| console.setLevel(logging.INFO) | |
| formatter = logging.Formatter('%(asctime)-12s: %(levelname)-8s: %(message)s', datefmt='%m-%d %H:%M') |
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 flatten_generic_value(val){ | |
| if(val.type === 'container'){ | |
| return flatten_generic(val['container_value']); | |
| } else if(val.type === 'list'){ | |
| return val.list_value.map(flatten_generic_value); | |
| } else { | |
| return val[val.type + '_value']; | |
| } | |
| }; |
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
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <script src="//ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> | |
| <script src="/static/socket.io.js"></script> | |
| <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.0.1/angular.min.js"></script> | |
| <script> | |
| angular.module('app', []) | |
| .controller('logs', function($scope){ |