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
# -*- coding: utf-8 -*- | |
''' | |
models: sample | |
:author: Sam Gammon (sam@momentum.io) | |
:copyright: (c) 2013 momentum labs. | |
:license: This is private source code - all rights are reserved. For details about | |
embedded licenses and other legalese, see `LICENSE.md`. | |
''' |
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
# -*- coding: utf-8 -*- | |
''' | |
api sample: service | |
:author: Sam Gammon (sam@momentum.io) | |
:copyright: (c) 2013 momentum labs. | |
:license: This is private source code - all rights are reserved. For details about | |
embedded licenses and other legalese, see `LICENSE.md`. | |
''' |
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
# -*- coding: utf-8 -*- | |
# apptools RPC | |
from apptools import rpc | |
## TrackerException - abstract parent for all exceptions related to :py:class:`Tracker`. | |
class TrackerException(rpc.remote.ApplicationError): pass |
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
# -*- coding: utf-8 -*- | |
""" | |
Runserver for apptools-based services and handlers. | |
""" | |
from gevent import pywsgi | |
from apptools import dispatch |
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
# make our variables | |
vowels = ['a', 'e', 'i', 'o', 'u'] | |
words = ['here', 'yup', 'nnn', 'bllble'] | |
# empty results list that will contain tuples of (<word>, <vowel>) where `vowel` is `True` or `False` | |
results = [] | |
for word in words: | |
for vowel in vowels: | |
if vowel in word: |
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
# -*- coding: utf-8 -*- | |
""" | |
Welcome to the :py:mod:`apptools` Model API! Using this package, you can model data, | |
interact with datastore layers through Model Adapters (see: :py:mod:`adapters`), | |
and generate messages for use with Service classes. | |
:author: Sam Gammon (sam@momentum.io) | |
:copyright: (c) 2013 momentum labs. | |
:license: This is private source code - Ampush has been granted an |
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
/* | |
* | |
* Base64 for JavaScript | |
* -- A clean and compact implementation -- | |
* | |
* @author Sam Gammon <sg@samgammon.com> | |
*/ | |
(function (context) { | |
var Base64 = context.Base64 = { |
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
# -*- coding: utf-8 -*- | |
''' | |
apptools2: model API | |
------------------------------------------------- | |
| | | |
| `apptools.model` | | |
| | | |
| a general-purpose, minimalist toolkit for | |
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
from protorpc import messages | |
from apptools import services | |
## Request message | |
class HelloRequest(messages.Message): | |
''' Request ProtoRPC message for `AJ.hello`. ''' | |
name = messages.StringField(1, default='AJ') |
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
{ | |
"id": "10152532360095651", | |
"from": { | |
"name": "<user's name>", | |
"id": "<user's fbid>" | |
}, | |
"start_time": "2013-01-30T01:42:18+0000", | |
"end_time": "2013-01-30T01:42:18+0000", | |
"publish_time": "2013-01-30T01:42:18+0000", | |
"application": { |