This file contains 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
'use strict'; | |
// data structure that is in the props | |
// head = { | |
// title: 'title' | |
// description: 'description' | |
// canonical: 'http://www.whatever.com' | |
// link: [ | |
// { | |
// href: "https://www.nextpage.com", |
This file contains 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 default { | |
scrollY: '', | |
getScrollY() { | |
return (window.pageYOffset !== undefined) ? window.pageYOffset : (document.documentElement || document.body.parentNode || document.body).scrollTop; | |
}, | |
init() { | |
window.addEventListener('scroll', (e) => { | |
this.scrollY = this.getScrollY(); |
This file contains 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 readline = require('readline'); | |
process.stdin.setEncoding('utf8'); | |
let n = null | |
let w = null | |
let firstParamsSet = false | |
let values = [] | |
const rl = readline.createInterface({ |
This file contains 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, { PropTypes, Component } from 'react' | |
class ContextExample extends Component { | |
static childContextTypes = { | |
config: PropTypes.object, | |
} | |
getChildContext() { |
This file contains 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
{ | |
"Version": "2012-10-17", | |
"Id": "Policy1489770524467", | |
"Statement": [ | |
{ | |
"Sid": "Stmt1489770487230", | |
"Effect": "Allow", | |
"Principal": { | |
"AWS": "[arn of iam user you created for circleci]" | |
}, |
This file contains 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
class Page extends Component { | |
static fetch(match, location, options) { | |
//return a promise to be resolved later, superagent as an example | |
return request('GET', '/search') | |
} | |
render() { | |
//your stuff | |
} |
This file contains 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
reactRouterFetch(routeConfig, location, { dispatch }) | |
.then((results) => { | |
this.setState({ | |
isAppFetching: false | |
}) | |
}) | |
.catch((err) => { | |
this.setState({ | |
isAppFetching: false, | |
appFetchingError: err |
This file contains 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, { Component } from 'react' | |
import { withRouter } from 'react-router' | |
import reactRouterFetch from 'react-router-fetch' | |
class App extends Component { | |
state = { | |
isAppFetching: false, | |
appFetchingError: null | |
} |
This file contains 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
deployment: | |
prod: | |
branch: master | |
commands: | |
- NODE_ENV=production REACT_APP_GIT_SHA=$CIRCLE_SHA1 REACT_APP_ROLLBAR_TOKEN=$ROLLBAR_TOKEN yarn run build |
This file contains 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
<% if (process.env.NODE_ENV !== 'development') { %> | |
<script> | |
var _rollbarConfig = { | |
accessToken: '%REACT_APP_ROLLBAR_TOKEN%', | |
captureUncaught: true, | |
captureUnhandledRejections: true, | |
payload: { | |
environment: '%NODE_ENV%', | |
client: { | |
javascript: { |
OlderNewer