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
fragment userAllFields on User { | |
id | |
name | |
age | |
gender | |
} | |
query($superUserId: Int, $staffUserId: Int) { | |
users { |
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
fragment userAllFields on User { | |
id | |
name | |
age | |
gender | |
} | |
query { | |
users { |
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
schema { | |
query: Query | |
mutation: Mutation | |
} | |
interface Character { | |
name: String | |
} | |
type CreateUser { |
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
println(Jenkins.getAuthentication().getAccessToken()); |
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 boto3 | |
import time | |
timestamp = int(time.time()) | |
session = boto3.Session( | |
aws_access_key_id=aws_access_key_id, | |
aws_secret_access_key=aws_secret_access_key, | |
region_name=region_name | |
) |
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 -*- | |
class LoupQuery(Query): | |
pass | |
db_session = scoped_session( | |
sessionmaker( | |
autocommit=False, | |
autoflush=False, |
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 SerializerMixin(object): | |
""" | |
Mixin class for models. | |
Model define:: | |
class User(SerializerMixin): | |
id = None | |
name = None | |
fields = ('id', 'name') | |
def __init__(self, _id, name): | |
self.id = _id |
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 urllib, cStringIO | |
from wand.image import Image | |
url = 'http://img3.wikia.nocookie.net/__cb20100520131746/logopedia/images/5/5c/Google_logo.png' | |
f = cStringIO.StringIO(urllib.urlopen(url).read()) | |
i = Image(file=f) | |
>>> <wand.image.Image: 74d025d 'PNG' (3548x1243)> |
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 -*- | |
from flask import abort | |
from datetime import datetime | |
from project.ext import db | |
class IdMixin(object): | |
""" | |
Provides the :attr:`id` primary key column |
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
app.factory('Logger', function(localStorageService) { | |
var getUUID = function() { | |
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) { | |
var r = Math.random()*16|0, v = c == 'x' ? r : (r&0x3|0x8); | |
return v.toString(16); | |
}); | |
}; | |
var createTouchEvent = function(el, x, y) { |