start new:
tmux
start new with session name:
tmux new -s myname
| { | |
| "parser": "babel-eslint", | |
| "plugins": [ | |
| "flowtype" | |
| ], | |
| "rules": { | |
| "flowtype/require-parameter-type": 1, | |
| "flowtype/require-return-type": [ | |
| 1, | |
| "always", |
| docker run -v /datadir:/data/db --name mongo -d mongo --auth | |
| docker exec -it mongo mongo | |
| > use admin | |
| > db.system.users.find() | |
| > db.createUser({ user: 'admin', pwd: 'admin', roles: [ { role: "root", db: "admin" } ] }); | |
| > use some-db | |
| > db.createUser({ user: 'user', pwd: 'user', roles: [ "readWrite" ] }); |
facebook-regenerator or babel-polyfill to run it.interface Generator extends Iterator {
Know what you have in your pocket.
User webpack -json > tree.json to get all the information about your modules.
For visualization, put the tree.json to this https://webpack.github.io/analyse/#home
To parse those information to human-readable code, use this package https://github.com/robertknight/webpack-bundle-size-analyzer with its command webpack --json | webpack-bundle-size-analyzer
To minimize your scripts (and your css, if you use the css-loader) webpack supports a simple option:
| const initialLoadRequest = (dispatch) => { | |
| const fetchForm = fetchLoginForm; | |
| const sessionStatus = getSessionStatus; | |
| return Promise.props({ | |
| form: (() => { | |
| const loginFormAction = fetchForm(); | |
| dispatch(loginFormAction); | |
| return loginFormAction.promise; | |
| })(), |
| export default function parrallelPromises (store) { | |
| return next => action => { | |
| const { parrallelPromises } = action; | |
| if (!parrallelPromises) { | |
| return next(action); | |
| } | |
| return Promise.props(parrallelPromises) | |
| .then((results) => { | |
| return store.dispatch(results); |
| var Q = require('q'); | |
| var request = require('request'); | |
| var Promise = require('bluebird') | |
| var numberOfArticle = 0; | |
| function getArticleUrlPerPage(pageNumber, articleUrls) { | |
| var options = { | |
| method: 'GET', | |
| url: 'https://www.getnewsmart.com/?last_time_title=This+week&page=' + pageNumber + '§ion=&xhr=true', | |
| }; |
| var expect = require('chai').expect; | |
| var jsdom = require('mocha-jsdom'); | |
| var generateDOM = require('../src/index'); | |
| describe('Generate', function() { | |
| jsdom(); | |
| it('should render children nodes', function(){ | |
| var source = { |
| function mapValues(obj, fn) { | |
| return Object.keys(obj).reduce((result, key) => { | |
| // call fn() and re-assign it to results. | |
| result[key] = fn(obj[key], key); | |
| return result; | |
| }, {}); | |
| } | |
| function pick(obj, fn) { | |
| return Object.keys(obj).reduce((result, key) => { |