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: | |
auth = OAuth(access_token) if use_auth else None | |
payload_data = json.dumps(payload) if payload is not None else None | |
if payload_data is None: | |
request = requests.Request(method, url, params=params, auth=auth).prepare() | |
else: | |
request = requests.Request(method, url, params=params, data=payload_data, auth=auth).prepare() | |
request.headers['Content-Type'] = 'application/json' |
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
@oauth_provider.invalid_response | |
def invalid_response(req): | |
if req.error_message == 'Bearer token is expired.': | |
raise ExpiredError | |
elif req.error_message == 'Bearer token scope not valid.': | |
raise NoPermissionError | |
else: | |
raise RequiredSignInError |
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.route('/oauth/login', methods=['GET']) | |
def oauth_login(): | |
form_data = { | |
'code': request.args['code'], | |
'redirect_uri': url_for('oauth_login', _external=True), | |
'grant_type': 'authorization_code', | |
'client_id': app.config.get('OAUTH_CLIENT_ID'), | |
'client_secret': app.config.get('OAUTH_CLIENT_SECRET'), | |
'scope': 'god' | |
} |
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 get_oauth_req_url(): | |
params = { | |
'client_id': app.config.get('OAUTH_CLIENT_ID'), | |
'response_type': 'code', | |
'scope': 'god', | |
'next': urlparse(request.url).path | |
} | |
return "{0}/oauth/authorize?{1}".format(app.config.get('OAUTH_SERVER'), urlencode(params)) |
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
HCOPY 000000001033 | |
DBUFFER000033BUFEND001033LENGTH00002D | |
RRDREC WRREC | |
T0000001D1720274B1000000320232900003320074B1000003F2FEC0320160F2016 | |
T00001D0D0100030F200A4B1000003E2000 | |
T00003003454F46 | |
M00000405+RDREC | |
M00001105+WRREC | |
M00002405+WRREC | |
E000000 |
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
#include <stdio.h> | |
#include <limits.h> | |
#include <math.h> | |
#include <stdlib.h> | |
#include <time.h> | |
#include <sys/time.h> | |
#define Random0to1 ((double) rand() / (RAND_MAX)) + 1 | |
#define ITERATION 100000000 |
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
package codelab.gdg.watchfacehack; | |
import android.graphics.Canvas; | |
import android.graphics.Rect; | |
import android.support.wearable.watchface.CanvasWatchFaceService; | |
import android.view.SurfaceHolder; | |
public class AnalogWatchFaceService extends CanvasWatchFaceService { | |
@Override |
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
helloworld |
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
cmake_minimum_required(VERSION 2.8.4) | |
project(helloworld) | |
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") | |
######################################################### | |
# Include Files | |
######################################################### | |
set(SOURCE_FILES main.cpp Cool.cpp) | |
add_executable(helloworld ${SOURCE_FILES}) |
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
using UnityEngine; | |
using System.IO; | |
public class Logger : MonoBehaviour | |
{ | |
StreamWriter _writer; | |
public void Prepare() | |
{ | |
#if UNITY_EDITOR |