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
/** | |
* @license AngularJS v1.0.0rc12 | |
* (c) 2010-2012 Google, Inc. http://angularjs.org | |
* License: MIT | |
*/ | |
(function(window, angular, undefined) { | |
'use strict'; | |
/** | |
* @ngdoc overview |
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/python | |
# -*- coding: utf-8 -*- | |
__author__ = 'broken' | |
import os | |
import zipfile | |
import yaml | |
from shutil import copy2 |
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 _validate(self, value): | |
if isinstance(value, str): | |
# Decode from UTF-8 -- if this fails, we can't write it. | |
try: | |
value = unicode(value, 'utf-8') | |
except UnicodeError: | |
raise datastore_errors.BadValueError('Expected valid UTF-8, got %r' % | |
(value,)) | |
elif not isinstance(value, unicode): | |
raise datastore_errors.BadValueError('Expected string, got %r' % |
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
>>> [n for n in xrange(19) if n > 10] | |
[11, 12, 13, 14, 15, 16, 17, 18] | |
>>> next(n for n in xrange(19) if n > 10) | |
11 | |
>>> |
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
// Example usage of http-service | |
(function (window) { | |
"use strict"; | |
var angular = window.angular, | |
appModule = angular.module('app', ['httpService']); | |
appModule.controller('BaseCtrl', ['HttpService', function (HttpService) { | |
// Example GET, with query param, success and error callbacks | |
HttpService.get('/api/monkey', { |
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
## First fetch all assingments | |
qp = QueryParser({'assigned_to': [('=', account_id)]}) | |
assignments = IssueAssignFactory.fetch(filters=qp.filters).resolve() # Do later, just for show | |
## Make new IssueAssignFactory.fetch that only fetch keys | |
# Alt 1 | |
issues = ndb.get_multi([assignment.key().parent() for assignment in assignments]) | |
# Alt 2, bad idea i think | |
qp = QueryParser({'key': [('=', [assignment.key().parent() for assignment in assignments])]}) |
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/python | |
# -*- coding: utf-8 -*- | |
import re | |
import argparse | |
import os | |
import zipfile | |
import yaml | |
from subprocess import call | |
__author__ = 'broken' |
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
/** AMD **/ | |
define([ | |
'angular' | |
'common/security/constants' | |
], function (angular) { | |
'use strict'; | |
angular.module('security.someModule', [ | |
'security.constants' | |
]) |
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 datetime import datetime, tzinfo, timedelta | |
class TZOffset(tzinfo): | |
def __init__(self, offset=0, *args, **kwds): | |
self.gmt_offset = offset | |
super(TZOffset, self).__init__(*args, **kwds) | |
def utcoffset(self, dt): | |
return timedelta(hours=self.gmt_offset) + self.dst(dt) | |
def tzname(self,dt): | |
return "GMT %s%s" % (('+' if self.gmt_offset > 0 else ''), self.gmt_offset) |
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 uuid | |
from flask import Flask | |
from flask import jsonify | |
from flask import request | |
from flask import make_response | |
from werkzeug import secure_filename | |
UPLOAD_FOLDER = os.path.dirname(os.path.realpath(__file__)) | |
ALLOWED_EXTENSIONS = set(['txt', 'pdf', 'png', 'jpg', 'jpeg', 'gif']) |
OlderNewer