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 json | |
| import logging | |
| from flask import Flask, g | |
| from flask_oidc import OpenIDConnect | |
| import requests | |
| logging.basicConfig(level=logging.DEBUG) | |
| app = Flask(__name__) |
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
| { | |
| "Mappings": { | |
| "RegionMap": { | |
| "ap-northeast-1": { "AMI": "ami-f61c3e91" }, | |
| "ap-southeast-1": { "AMI": "ami-4d348a2e" }, | |
| "eu-west-1": { "AMI": "ami-8f043ee9" }, | |
| "sa-east-1": { "AMI": "ami-19492b75" }, | |
| "us-east-1": { "AMI": "ami-500d8546" }, | |
| "us-west-1": { "AMI": "ami-252a0f45" }, | |
| "us-west-2": { "AMI": "ami-112cbc71" } |
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
| Q = require('q'); | |
| var getData = function() { | |
| var deferred = Q.defer(); | |
| setTimeout(function() { | |
| deferred.reject(new Error("Can't get data")); | |
| }, 200); | |
| return deferred.promise; | |
| }; |
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
| Q = require('q'); | |
| var getData = function() { | |
| var deferred = Q.defer(); | |
| setTimeout(function() { | |
| deferred.reject(new Error("Can't get data")); | |
| }, 200); | |
| return deferred.promise; | |
| }; |
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
| Q = require('q'); | |
| var getData = function() { | |
| var deferred = Q.defer(); | |
| setTimeout(function() { | |
| deferred.reject(new Error("Can't get data")); | |
| }, 200); | |
| return deferred.promise; | |
| }; |
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
| Q = require('q'); | |
| var getData = function() { | |
| var deferred = Q.defer(); | |
| setTimeout(function() { | |
| var local = 10; | |
| deferred.resolve(local); | |
| }, 200); | |
| return deferred.promise; |
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
| var getData = function() { | |
| setTimeout(function() { | |
| var local = 10; | |
| return local; | |
| }, 200); | |
| }; | |
| var getMoreData = function() { | |
| setTimeout(function() { | |
| var local = 20; | |
| return local; |
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
| Q = require('q'); | |
| var getData = function() { | |
| var deferred = Q.defer(); | |
| setTimeout(function() { | |
| var local = 10; | |
| deferred.resolve(local); | |
| }, 200); | |
| return deferred.promise; |
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
| var getData = function() { | |
| setTimeout(function() { | |
| var local = 10; | |
| return local; | |
| }, 200); | |
| }; | |
| var addData = function(input) { | |
| setTimeout(function() { | |
| var local = input + 2; | |
| return local; |
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
| Q = require('q'); | |
| var getData = function() { | |
| var deferred = Q.defer(); | |
| setTimeout(function() { | |
| var local = 10; | |
| deferred.resolve(local); | |
| }, 200); | |
| return deferred.promise; |
NewerOlder