- Location - The location of the application. Usually just a URL, but the location can contain multiple pieces of information that can be used by an app
- pathname - The "file/directory" portion of the URL, like
invoices/123 - search - The stuff after
?in a URL like/assignments?showGrades=1. - query - A parsed version of search, usually an object but not a standard browser feature.
- hash - The
#portion of the URL. This is not available to servers inrequest.urlso its client only. By default it means which part of the page the user should be scrolled to, but developers use it for various things. - state - Object associated with a location. Think of it like a hidden URL query. It's state you want to keep with a specific location, but you don't want it to be visible in the URL.
- pathname - The "file/directory" portion of the URL, like
React recently introduced an experimental profiler API. This page gives instructions on how to use this API in a production release of your app.
Table of Contents
React DOM automatically supports profiling in development mode for v16.5+, but since profiling adds some small additional overhead it is opt-in for production mode. This gist explains how to opt-in.
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
| public class AuthenticatingHandler<T> : DelegatingHandler where T : ISecurityTokenAccessor | |
| { | |
| private readonly Policy<HttpResponseMessage> _policy; | |
| private readonly T _securityTokenAccessor; | |
| private IAccessToken _accessToken; | |
| private AuthenticationHeaderValue _authenticationHeader; | |
| public AuthenticatingHandler(T securityTokenAccessor) | |
| { | |
| _securityTokenAccessor = securityTokenAccessor; |
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 React from 'react' | |
| import { StyleSheet, Text, View, TouchableWithoutFeedback } from 'react-native' | |
| import { Spring, animated } from 'react-spring/dist/native' | |
| const styles = { | |
| flex: 1, | |
| margin: 0, | |
| borderRadius: 35, | |
| backgroundColor: 'red', | |
| alignItems: 'center', |
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
| const stream = require('stream') | |
| const cache = new Map() // you might wanna use an lru here | |
| function createCacheStream (url) { | |
| const buf = [] | |
| return stream.Transform({ | |
| transform: function (data, enc, cb) { | |
| buffer.push(data) | |
| cb(null, data) | |
| }, |
Download the following repositories and run yarn install in each:
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
| dialog { | |
| position: fixed; | |
| top: 50%; | |
| left: 50%; | |
| right: auto; | |
| padding: 30px; | |
| transform: perspective(500px) translate(-50%, -50%); | |
| background: linear-gradient(to bottom, #FFF, #F4F4F4) #FFF; | |
| border: none; | |
| border-radius: 3px; |
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
| <div class="row"> | |
| <div class="col-md-3"> | |
| <h3>Select files</h3> | |
| <input type="file" #fileInput multiple (change)="addToQueue()" /> | |
| </div> | |
| <div class="col-md-9"> | |
| <h3>Upload queue</h3> | |
| <table class="table-headed table-striped"> |
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 { Directive, ElementRef, forwardRef, Input, Renderer2 } from '@angular/core'; | |
| import { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms'; | |
| import { fromEvent } from 'rxjs/observable/fromEvent'; | |
| import { merge } from 'rxjs/observable/merge'; | |
| import { timer } from 'rxjs/observable/timer'; | |
| import { Subscription } from 'rxjs/Subscription'; | |
| export const DEFAULT_VALUE_ACCESSOR : any = { | |
| provide: NG_VALUE_ACCESSOR, | |
| useExisting: forwardRef(() => NgControlOptionsDirective), |
NewerOlder