A Pen by Po-Ying Chen on CodePen.
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 http = require('http') | |
| import https = require('https') | |
| import url = require('url') | |
| import {AxiosInstance, AxiosInterceptorManager} from 'axios' | |
| import {HttpRequestOptions as HttpFollowRequestOptions, http as httpFollow, https as httpsFollow} from 'follow-redirects' | |
| import now = require('performance-now') | |
| import httpAdapter = require('axios/lib/adapters/http') | |
| import InterceptorManager = require('axios/lib/core/InterceptorManager') |
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
| user www-data; | |
| http { | |
| ## | |
| # Basic Settings | |
| ## | |
| sendfile on; | |
| tcp_nopush on; |
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
| // maybe that can compose graphql api? | |
| /* | |
| Using Es6 Proxies, I created an object that can resolve promises from a chained object accessor pattern. | |
| simply await the values, or supply a callback to .then() and watch the magic. | |
| */ | |
| Symbol.queue = Symbol("queue"); //using Symbols to hide properties from being used or altered | |
| Symbol.data = Symbol("data"); | |
| function Promiser( obj ) { | |
| return new Proxy(obj, { |
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
| /** | |
| * Module dependencies. | |
| */ | |
| var net = require('net'); | |
| var inherits = require('util').inherits; | |
| var EventEmitter = require('events').EventEmitter; | |
| /** |
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
| Function.prototype.bind=(function(){}).bind||function(b){if(typeof this!=="function"){throw new TypeError("Function.prototype.bind - what is trying to be bound is not callable");}function c(){}var a=[].slice,f=a.call(arguments,1),e=this,d=function(){return e.apply(this instanceof c?this:b||window,f.concat(a.call(arguments)));};c.prototype=this.prototype;d.prototype=new c();return d;}; |
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
| DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE | |
| Version 2, December 2004 | |
| Copyright (C) 2015 Fedia <fedia@psih.ru> | |
| Everyone is permitted to copy and distribute verbatim or modified | |
| copies of this license document, and changing it is allowed as long | |
| as the name is changed. | |
| DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE |
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
| export class HttpClient { | |
| constructor(defaults) { | |
| this.defaults = defaults; | |
| this.interceptors = []; | |
| this.activeRequestCount = 0; | |
| this.isRequesting = false; | |
| } | |
| addInterceptor(interceptor) { | |
| this.interceptors.push(interceptor); |
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
| # | |
| # CORS header support | |
| # | |
| # One way to use this is by placing it into a file called "cors_support" | |
| # under your Nginx configuration directory and placing the following | |
| # statement inside your location block(s): | |
| # | |
| # include cors_support; | |
| # | |
| # A limitation to this method is that Nginx doesn't currently send headers |
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
| <script src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.3.9/angular.min.js"></script> | |
| <script src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.3.9/angular-route.min.js"></script> | |
| <style> | |
| a, a:hover { | |
| text-decoration: none; | |
| } | |
| #content{ | |
| border:2px solid #e5e5e5; | |
| overflow: hidden; |