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
alias push="git pull; git push" | |
alias zuul="cd ~/git/zuul/; java -Dzuul.host.socket-timeout-millis=250000 -jar target/*.jar" | |
webstorm="cd ~/WebStorm-193.5662.54/bin/webstorm.sh" | |
alias nodeapp="nodemon -e jsx,js,json,html,css,yml,ts app.js" | |
alias go="npm start" | |
alias start="a & b" | |
a() { | |
echo "running zuul" | |
cd ~/git/zuul/; java -Dzuul.host.socket-timeout-millis=250000 -jar target/*.jar |
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": { | |
"ng": "ng", | |
"start": "npm run noreload", | |
"build": "ng build --prod", | |
"test": "ng test", | |
"lint": "ng lint", | |
"lint-fix": "ng lint --fix", | |
"e2e": "ng e2e", | |
"update": "ng update --all", |
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 | |
#### https://git-scm.com/docs/git-reset | |
git reset @~ | |
git push -f origin <hash>:<branch> |
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
/** | |
* loop through the config obj and delete the things we do not need | |
* to make a params obj from the config obj | |
*/ | |
static objFromConfig(params) { | |
const newObj = JSON.parse(JSON.stringify(params)); | |
Object.entries(newObj).map(([k, v]) => { | |
if (v === null || v === '') { | |
delete newObj[k]; | |
} |
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
sortByEarliestDate(arr) { | |
return arr.sort((a: number, b: number) => { | |
return +new Date(a['sort']) - +new Date(b['sort']); | |
}); | |
} |
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
b.filter(o => !a.find(o2 => o.id === o2.id)) | |
b.filter(({ value: id1 }) => !a.some(({ value: id2 }) => id2 === id1)); |
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
purchaseOrderIds = ['12345', '67890']; | |
getPurchaseOrderDetails() { | |
const promises = []; | |
this.purchaseOrderIds.map(x => { | |
promises.push(new Promise((resolve) => { | |
this.purchaseOrderService.getPurchaseOrder(x) | |
.subscribe( | |
res => { | |
resolve(res); |
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 arr = [ { key: 1 }, { key: 2 }, { key: 3 } ] | |
const results = arr.map(async (obj) => { return obj.key; }); | |
Promise.all(results).then((completed) => console.log('done', arr); |
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
// Fiddle: http://jsfiddle.net/wholypantalones/eL6zys0c/ | |
const classString = 'btn-lg btn-block btn-success'; | |
const classArray = classString.match(/\S+/g); | |
//output ["btn-lg", "btn-block", "btn-success"]; |
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
config = { | |
page: 0, | |
pageSize: 25, | |
sortColumn: 'publishDate', | |
sortDirection: 'ASC' | |
}; | |
/** | |
* loop through the config block and delete the things we do not need | |
* to make a params obj from the config obj |
NewerOlder