-
hareware: GCE g1-small instance (1 vCPU, 1.7 GB memory), about $15/mo
-
software (Archlinux):
sudo pacman -Sy nginx certbot docker docker-compose
# optional tools
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; | |
} |
function initShaders( gl, vertexShaderId, fragmentShaderId ) | |
{ | |
var vertShdr; | |
var fragShdr; | |
var vertElem = document.getElementById( vertexShaderId ); | |
if ( !vertElem ) { | |
alert( "Unable to load vertex shader " + vertexShaderId ); | |
return -1; | |
} |