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://docs.google.com/spreadsheets/d/1POnoeD6A0_Z8IBonxp5g_gkzU7QWA3ypQX6KT8uNbRI/edit |
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 pprint import pprint | |
import pymongo | |
client = pymongo.MongoClient() | |
db = client.test_database | |
if not db.users.count(): | |
db.users.insert({ |
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
def user_validator(obj): | |
return True | |
class BaseHandler(object): | |
validator = None | |
def post(self, data): | |
if self.validator(data): | |
return 'ok' | |
else: |
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
function load_and_get(content, id) { | |
var obj = content.get(id); | |
if (!obj) { | |
content.load(id); | |
obj = content.get(id); | |
} | |
return obj; | |
} | |
function load_track_from_album(album, options) { |
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
try: | |
import gitinfo as GIT_INFO | |
GIT_INFO_BRANCH = GIT_INFO.BRANCH | |
GIT_INFO_REV = GIT_INFO.REV | |
except ImportError: | |
GIT_INFO = object() | |
GIT_INFO_BRANCH = '-1' | |
GIT_INFO_REV = '-1' |
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
import os | |
import sublime_plugin | |
#============================================================================== | |
# Helpers | |
#============================================================================== | |
def get_tests_path(filename): | |
""" |
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 django import forms | |
from django.shortcuts import redirect | |
from django.views.generic import TemplateView | |
class MyForm(forms.Form): | |
datafield = forms.CharField(max_length=255) | |
class MyView(TemplateView): |
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
import sys | |
import argparse | |
import Image | |
import ImageFilter | |
from numpy import exp, mgrid | |
def resize(args): | |
image = Image.open(args.image) |
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
Ti.API.debug "In tango.init" | |
IMPORTED = [] | |
# Setting sys.path | |
sys = {} | |
sys.path = ['site-packages', '.'] | |
class ImportError extends Error | |
constructor: (@message, @fileName, @lineNumber) -> |
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
class ResultAttr: | |
attr_names = set(( | |
'_ResultAttr__value', '_ResultAttr__result', 'name')) | |
def __init__(self, name, value, result): | |
""" | |
Proxy class for `Result` attributes | |
Arguments: | |
- `name`: attribute name, for example 'user' |
NewerOlder