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.FROM_EMAIL) { | |
console.log('Please set: FROM_EMAIL environment variable. This is a validated email address to send emails from to other users for email verification, reset pwd etc') | |
process.exit(); | |
} | |
if(!process.env.POSTMARK_API_TOKEN) { | |
console.error('Error! Please set POSTMARK_API_TOKEN from postmark email service.'); | |
process.exit(); | |
} |
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 const slugifyText = text => | |
text | |
.toString() | |
.toLowerCase() | |
.replace(/\s+/g, '-') // Replace spaces with - | |
.replace(/[^\w-]+/g, '') // Remove all non-word chars | |
.replace(/\-\-+/g, '-') // Replace multiple - with single - | |
.replace(/^-+/, '') // Trim - from start of text | |
.replace(/-+$/, ''); |
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 routes = ( | |
<Router history={browserHistory}> | |
<Route path="/"> | |
<Route path="/posts/:id" component={PostPage} /> | |
</Route> | |
</Router> | |
) | |
<button onClick={() => browserHistory.push(`/posts/${post.id}`)}></button> |
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
{ | |
"name": "component-archetype", | |
"version": "0.0.1-semantic", | |
"description": "A new Webpack boilerplate with hot reloading React components, and error handling on module and component level.", | |
"main": "lib/index.js", | |
"scripts": { | |
"clean": "rimraf lib", | |
"build:webpack": "cross-env NODE_ENV=production webpack --config webpack.config.prod.js", | |
"build:babel": "NODE_ENV=lib babel src --out-dir lib", | |
"build": "npm run clean && npm run build:babel", |
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
"scripts": { | |
"test": "jest", | |
"test:watch": "jest --watch", | |
"test:coverage": "jest --coverage" | |
}, | |
"jest": { | |
"setupFiles": ["./test/jestsetup.js"], | |
"snapshotSerializers": [ | |
"<rootDir>/node_modules/enzyme-to-json/serializer" | |
] |
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
function CustomForm ({handleSubmit}) { | |
let inputElement | |
return ( | |
<form onSubmit={() => handleSubmit(inputElement.value)}> | |
<input | |
type='text' | |
ref={(input) => inputElement = input} /> | |
<button type='submit'>Submit</button> | |
</form> | |
) |
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
lsof -i:3000 |
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
<Menu widths={3}> | |
<Menu.Item name="" /> | |
<Menu.Item><img src={logo} /></Menu.Item> | |
<Menu.Item name="Hello" /> | |
</Menu> |
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
"now-build": "echo 'not building'" |
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
yarn upgrade-interactive |