// function scope for moduling
!function() {
var style = document.createElement('style');
style.innerText = '::-webkit-scrollbar { width: 8px; }';
document.getElementsByTagName('head')[0].appendChild(style);
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 PromiseArray = []; | |
| el.addEventListener('scroll', function(e) { | |
| PromiseArray.push(new Promise(...)); | |
| forEachForPromise(); | |
| }); | |
| function forEachForPromises() { | |
| PromiseArray.filter(function(promise) { | |
| promise.then(function(data) { |
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 observableStream = Rx.Observable.create(function (observer) { | |
| var url1 = 'http://hello-universe.com'; | |
| var url2 = 'http://hello-world.com'; | |
| var defaultValue = {}; | |
| observer.onNext(defaultValue); | |
| $.get(url1).then(function(data) { | |
| observer.onNext(data); | |
| return $.get(url2); |
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 observableStream = Rx.Observable.create(function(observer) { | |
| observer.onNext(1); | |
| }); | |
| var subscriber = observableStream.subscribe(function(data) { | |
| console.log('data', data); | |
| if (data) { | |
| subscriber.dispose(); | |
| } |
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() { | |
| window.UAParserBackup = window.UAParser | |
| }).call(this), | |
| function(t) { | |
| "use strict"; | |
| var e = t.userAgent = function(t) { | |
| function e(t) { | |
| var e = {}, | |
| i = /(dolfin)[ \/]([\w.]+)/.exec(t) || /(chrome)[ \/]([\w.]+)/.exec(t) || /(opera)(?:.*version)?[ \/]([\w.]+)/.exec(t) || /(webkit)(?:.*version)?[ \/]([\w.]+)/.exec(t) || /(msie) ([\w.]+)/.exec(t) || t.indexOf("compatible") < 0 && /(mozilla)(?:.*? rv:([\w.]+))?/.exec(t) || ["", "unknown"]; | |
| return "webkit" === i[1] ? i = /(iphone|ipad|ipod)[\S\s]*os ([\w._\-]+) like/.exec(t) || /(android)[ \/]([\w._\-]+);/.exec(t) || [i[0], "safari", i[2]] : "mozilla" === i[1] ? /trident/.test(t) ? i[1] = "msie" : i[1] = "firefox" : /polaris|natebrowser|([010|011|016|017|018|019]{3}\d{3,4}\d{4}$)/.test(t) && (i[1] = "polaris"), e[i[1]] = !0, e.name = i[1], e.version = n(i[2]), e |
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
| package com.features; | |
| import com.facebook.react.bridge.NativeModule; | |
| import com.facebook.react.bridge.ReactApplicationContext; | |
| import com.facebook.react.bridge.ReactContext; | |
| import com.facebook.react.bridge.ReactContextBaseJavaModule; | |
| import com.facebook.react.bridge.ReactMethod; | |
| import android.util.Log; |
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 { Injectable, Component } from '@angular/core'; | |
| @Injectable() | |
| export class AService { | |
| // ... | |
| } | |
| @Component({ | |
| // ... | |
| providers: [ AService ] |
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 { Injectable } from '@angular/core'; | |
| @Injectable() | |
| export class ValueConfig { | |
| title: string; | |
| getTitle(): string { | |
| return this.title; | |
| } | |
| } |
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 { Component } from '@angular/core'; | |
| @Component({ | |
| selector: 'sth', | |
| template: `<h2> Hello {{ title }} </h2>` | |
| }) | |
| export class TemplateTestComponent { | |
| title: string = " Something "; | |
| } |
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
| //Below is a JavaScript snippet that parses the response and returns the parameters to the server. | |
| // First, parse the query string | |
| var params = {}, queryString = location.hash.substring(1), | |
| regex = /([^&=]+)=([^&]*)/g, m; | |
| while (m = regex.exec(queryString)) { | |
| params[decodeURIComponent(m[1])] = decodeURIComponent(m[2]); | |
| } | |
| // And send the token over to the server |