近幾年來,JavaScript 可謂風生水起,從後端到前端,從 mobile 到 desktop,各種 module 滿天飛,信手拈來就是一個 web app。不過,「沒碰過 IE,別說你會做前端」,本人從超新手的角度出發,整理最近修正 IE 相容性遇到的坑與解法,給自己日後留個參考。
(撰於 2017-07-15,基於 IE 11/Edge 15)
| const ContactBadge = (props) => ( | |
| <div className='Badge' {...props}> | |
| <div>{props.user.name}</div> | |
| <div>{props.contactMethod.type}</div> | |
| </div> | |
| ); | |
| export default connect((state, {userId, contactMethodId}) => ({ | |
| user: selectUser(state, userId), | |
| contactMethod: selectContactMethod(state, contactMethodId) |
CloudFlare is an awesome reverse cache proxy and CDN that provides DNS, free HTTPS (TLS) support, best-in-class performance settings (gzip, SDCH, HTTP/2, sane Cache-Control and E-Tag headers, etc.), minification, etc.
löb is a well-known function in Haskell for implementing spreadsheet-like behaviors and tying the knot. It is defined as:
loeb :: Functor f => f (f a -> a) -> f a
loeb fs = xs
where xs = fmap ($ xs) fs| # npm using https for git | |
| git config --global url."https://github.com/".insteadOf [email protected]: | |
| git config --global url."https://".insteadOf git:// | |
| # npm using git for https | |
| git config --global url."[email protected]:".insteadOf https://github.com/ | |
| git config --global url."git://".insteadOf https:// |
##VGG19 model for Keras
This is the Keras model of the 19-layer network used by the VGG team in the ILSVRC-2014 competition.
It has been obtained by directly converting the Caffe model provived by the authors.
Details about the network architecture can be found in the following arXiv paper:
Very Deep Convolutional Networks for Large-Scale Image Recognition
K. Simonyan, A. Zisserman
| import { graphql, GraphQLString, GraphQLInt } from 'graphql'; | |
| import { objectType, enumType, schemaFrom, listOf } from 'graphql-schema'; | |
| import request from 'promisingagent'; | |
| const repositorySortEnum = enumType('RepositorySort') | |
| .value('CREATED', 'created') | |
| .value('UPDATED', 'updated') | |
| .value('PUSHED', 'pushed') | |
| .value('FULL_NAME', 'full_name') | |
| .end(); |
| // 可能可以改寫成這樣: | |
| LocationsFetcher.fetchLastResult = null; | |
| LocationsFetcher.fetch = () => | |
| if (LocationsFetcher.fetchLastResult) { | |
| return Promise.reject(new AlreadyCalledError()); | |
| } else { | |
| return LocationsFetcher.fetchLastResult = doFetchInternal(); | |
| } | |
| }; |
| // Simple wrapper to use bootstrap's grid system to position elements side-by-side | |
| var VerticalFieldsElement = React.createClass({ | |
| render: function() { | |
| return dom.div( | |
| { className: 'clearfix' }, | |
| React.Children.map(this.props.children, function(child) { | |
| if(!child) { | |
| return child; | |
| } |