This file contains hidden or 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
var gulp = require('gulp'); | |
var bs = require('browser-sync').create(); | |
var nodemon = require('gulp-nodemon'); | |
gulp.task('browser-sync', ['nodemon'], function() { | |
bs.init(null, { | |
// server side port | |
proxy: "http://localhost:3000", |
This file contains hidden or 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
var gulp = require('gulp'); | |
var nodemon = require('gulp-nodemon'); | |
var mocha = require('gulp-mocha'); | |
var wait = require('gulp-wait'); | |
var istanbul = require('gulp-istanbul'); | |
var plumber = require('gulp-plumber'); | |
gulp.task('pre-test', function () { | |
gulp.src(['server/**/*.js']) // Covering files | |
// with includeUntested option, Istanbul will check test coverage upon |
This file contains hidden or 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
alias gs='git status ' | |
alias ga='git add ' | |
alias gb='git branch ' | |
alias gc='git commit' | |
alias gd='git diff' | |
alias gco='git checkout ' | |
alias gk='gitk --all&' | |
alias gx='gitx --all' | |
alias g='git ' |
This file contains hidden or 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
var obj = {}; | |
obj.toString; | |
// function toString() { [native code] } | |
var emptyObj = Object.create(null); | |
emptyObj.toString; | |
// undefined | |
var map = new Map(); | |
map.get('toString'); |
This file contains hidden or 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
/* 빈 Map 만들기 */ | |
var map = new Map(); | |
// Map(0) {} | |
/* Key/value 저장하기 */ | |
map.set('first', 1); | |
map.set('second', 2); | |
/* Key/value 불러오기 */ | |
map.get('first'); |
This file contains hidden or 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
var keyFn = () => {}; | |
var keyObj = {}; | |
var keyArray = []; | |
map.set(1, 1); | |
map.set('two', 'two'); | |
map.set(keyFn, keyfn); | |
map.set(keyObj, keyObj); | |
map.set(keyArray, keyArray); |
This file contains hidden or 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
var obj = { a: 1, b: 2 }; | |
var count = 0; | |
for (var key in obj) { count++; } | |
console.log(count); | |
// 2 | |
var map = new Map([['a', 1], ['b', 2]]); | |
map.size | |
// 2 |
This file contains hidden or 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 } from 'react'; | |
export default class AsyncComponent extends React.Component { | |
static propTypes = { | |
loader: PropTypes.func.isRequired, | |
} | |
state = { | |
Component: null, | |
} |
This file contains hidden or 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 } from 'react'; | |
import AsyncComponent from './AsyncComponent'; | |
export const App = () => ( | |
<AsyncComponent loader={() => import('components/SomeComponent')} /> | |
) |
This file contains hidden or 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 SyncComponent from './SyncComponent'; | |
// Dynamic import | |
const dynamicImportPromise = import('./AsyncComponent'); | |
dynamicImportPromise.then((module) => { | |
/* DO SOMETHING */ | |
} |
OlderNewer