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
https://medium.com/stephenkoo/how-to-set-up-create-react-app-redux-react-router-redux-thunk-prettier-scss-airbnb-eslint-dda0bba5616a |
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
console.log(JSON.stringify(objName, null, 2)); |
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 doSomething(name) { | |
console.log('hello ' + name); | |
} | |
function loggingDecorator(wrappedFunction) { | |
return function() { | |
console.log('starting'); | |
const result = wrappedFunction.apply(this, arguments); | |
console.log('finished'); | |
return result; |
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
{ | |
"workbench.colorTheme": "One Dark+ (Sublime)", | |
"eslint.autoFixOnSave": true, | |
"terminal.integrated.shell.osx": "zsh", | |
"editor.tabSize": 2, | |
} |
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 products = [ | |
{ | |
price: '123', | |
name: 'cproduct1' | |
}, | |
{ | |
price: '50', | |
name: 'bproduct1' | |
}, | |
{ |
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 bookSlotByCustId(customerId) { | |
const custId = customerId | |
return function bookSlot(slotId) { | |
//psuedo code here: | |
dispatch({ | |
apiCall: api.bookSlot(custId, slotId) | |
}); | |
} | |
} |
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 INHERITANCE: | |
class GuitarAmp { | |
constructor ({ cabinet = 'spruce', distortion = '1', volume = '0' } = {}) { | |
Object.assign(this, { | |
cabinet, distortion, volume | |
}); | |
} | |
} | |
class BassAmp extends GuitarAmp { |
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
// ES6 class constructors MUST call super if they are subclasses. | |
// Thus, you have to call super() if you have a constructor. | |
// A subclass does not have to have a constructor (see #1) | |
// #1 no need to call super() here as there is no constructor | |
class MyClass extends React.Component { | |
render(){ | |
return <div>Hello { this.props.world }</div>; | |
} | |
} |
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
#!/bin/bash | |
# Delete all containers | |
docker rm $(docker ps -a -q) | |
# Delete all images | |
docker rmi $(docker images -q) |
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 hello(resolve) { | |
// do whatever | |
resolve(); | |
} | |
function hello2(resolve) { | |
// do whatever | |
resolve(); | |
} |