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
| function getEngine() { | |
| let counterValue = 1; | |
| const changeCounter = (increment = true) => { | |
| return increment ? ++counterValue : --counterValue; | |
| } | |
| return { | |
| increment: () => changeCounter(true), | |
| decrement: () => changeCounter(false), |
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
| true + false | |
| 12 / "6" | |
| "number" + 15 + 3 | |
| 15 + 3 + "number" | |
| null == '' | |
| null == 0 | |
| null == null | |
| undefined == undefined | |
| null == undefined |
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
| for (var i = 1; i <= 5; i++) { | |
| setTimeout(function() { console.log(i) }, 1000); | |
| } |
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
| export const COMMODITY = [ | |
| { | |
| id: 933, | |
| name: 'General Goods', | |
| description: 'General Goods', | |
| }, | |
| { | |
| id: 221, | |
| name: 'Advertising Materials/Books/Magazines', | |
| description: 'Advertising Materials/Books/Magazines', |
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
| // disable | |
| sudo mdutil -a -i off | |
| // enable | |
| sudo mdutil -a -i on | |
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
| /** | |
| * Deep diff between two object, using lodash | |
| * @param {Object} object Object compared | |
| * @param {Object} base Object to compare with | |
| * @return {Object} Return a new object who represent the diff | |
| */ | |
| function difference(object, base) { | |
| function changes(object, base) { | |
| return _.transform(object, function(result, value, key) { | |
| if (!_.isEqual(value, base[key])) { |
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
| pod cache clean --all | |
| pod cache clean 'alamofire' | |
| pod cache clean 'alamofire' --all |
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
| export class HelloComponent { | |
| innerFirstName: string; | |
| history = []; | |
| constructor() {} | |
| get fullName() { | |
| console.log("calculate fullName"); | |
| return `${this.innerFirstName} ${this.lastName}`; | |
| } |
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
| // if (localStorage.getItem('colums')) { | |
| // const columns = JSON.parse(localStorage.getItem('colums')); | |
| // this.gridOptions.columnApi.setColumnState(columns); | |
| // } |
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
| # generate mobx boilerplate | |
| flutter packages pub run build_runner build | |
| # generate mobx boilerplate --watch | |
| flutter packages pub run build_runner watch | |
| # delete before generation | |
| flutter packages pub run build_runner watch --delete-conflicting-outputs |