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 base64 | |
import logging | |
import simplejson as json | |
import os | |
import datetime | |
import functools | |
import gdata.apps.service | |
import gdata.apps.client | |
import gdata.auth | |
import gdata.gauth |
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 | |
import json | |
#logging.basicConfig(level=logging.DEBUG) | |
from oauth2client import client | |
import gdata.apps.service | |
from jwt_util import get_JWT, get_service_private_key, get_clientSecrets | |
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 re | |
class BrowserDetector(object): | |
def __init__(self): | |
self.patterns = [ | |
'.*(?P<browser>(MSIE|msie)) (?P<version>[0-9.]+).*', | |
'.* (VERSION|version)/(?P<version>[0-9.]+) (?P<browser>(SAFARI|safari))/.*', | |
'.*(?P<browser>(CHROME|chrome))/(?P<version>[0-9.]+).*', | |
'.*(?P<browser>(FIREFOX|firefox))/(?P<version>[0-9.]+).*', | |
] |
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
#!/usr/bin/env python2.6 | |
import base64 | |
import sys | |
import json | |
import imaplib | |
import urllib | |
from optparse import OptionParser | |
import atom.http_core |
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 functools | |
import logging | |
from django.utils import simplejson | |
def get_json_from_feed(user_feed): | |
"""Constructs and returns a JSON object from the given feed object | |
Args: | |
user_feed: A gdata.apps.UserFeed object |
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 base64 | |
import json | |
import urllib | |
import atom.http_core | |
from oauth2client import client | |
class Error(Exception): | |
def __str__(self): | |
return "Error: %s" % self.error_message |
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 flask | |
import logging | |
import json | |
from flask import request, redirect | |
import gdata.gauth | |
import gdata.apps.service | |
import gdata.apps.groups.service | |
import gdata.auth | |
from gdata.apps.service import AppsForYourDomainException |
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
$scope.safeApply = function(fn) { | |
var phase = this.$root.$$phase; | |
if(phase == '$apply' || phase == '$digest') | |
this.$eval(fn); | |
else | |
this.$apply(fn); | |
}; | |
// OR |
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 boto3 | |
import random | |
class S3(object): | |
def __init__(self, credentials=None): | |
if credentials: | |
self.resource = boto3.resource('s3', | |
aws_access_key_id=credentials['AccessKeyId'], | |
aws_secret_access_key=credentials['SecretAccessKey'], |
OlderNewer