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 API_URL = 'https://jsonmock.hackerrank.com/api/articles?author='; | |
async function fetchData(query) { | |
return new Promise(function (resolve, reject) { | |
https.get(`${API_URL}${query}`, (resp) => { | |
let data = ''; | |
// A chunk of data has been recieved. | |
resp.on('data', (chunk) => { | |
data += chunk; |
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
# This comman will delete all node_modules dirs from the directory it is execteud in till searching to 3rd subsircetory because of maxDepth=3. | |
find . -maxdepth 3 -name node_modules -type d -exec rm -rf {} \; |
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
PM2: | |
1. Run script on ubuntu to deploy node app | |
pm2 start npm --name "client" -- run prod | |
2. pm2 stop and delete process | |
p2 stop $NAME && p2 delete $NAME |
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
sudo chown -R $(whoami) /usr/local/ | |
sudo chown -R $(whoami):admin /usr/local | |
`Can't chown /usr/local in High Sierra` | |
sudo chown -R $(whoami) $(brew --prefix)/* |
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(t){function e(){}function n(t,e){return function(){t.apply(e,arguments)}}function i(t){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");if("function"!=typeof t)throw new TypeError("not a function");this._state=0,this._handled=!1,this._value=void 0,this._deferreds=[],c(t,this)}function o(t,e){for(;3===t._state;)t=t._value;return 0===t._state?void t._deferreds.push(e):(t._handled=!0,void i._immediateFn(function(){var n=1===t._state?e.onFulfilled:e.onRejected;if(null===n)return void(1===t._state?s:r)(e.promise,t._value);var i;try{i=n(t._value)}catch(t){return void r(e.promise,t)}s(e.promise,i)}))}function s(t,e){try{if(e===t)throw new TypeError("A promise cannot be resolved with itself.");if(e&&("object"==typeof e||"function"==typeof e)){var o=e.then;if(e instanceof i)return t._state=3,t._value=e,void a(t);if("function"==typeof o)return void c(n(o,e),t)}t._state=1,t._value=e,a(t)}catch(e){r(t,e)}}function r(t,e){t._state=2,t._value=e,a(t)}function a(t){2===t._state&& |
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://ant.design/docs/react/customize-theme | |
2nd method: | |
create a "theme.less" file | |
//theme.less content | |
@import "~antd/dist/antd.less"; | |
@primary-color : #fa8c16; //will set primary color of website as orange color |
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
import { fromJS } from 'immutable'; | |
const initialState = fromJS({ | |
panes: [{ | |
title: 'abc', | |
service: '', | |
tagName: '', | |
preDefinedApi: '', | |
methodType: '', |