Skip to content

Instantly share code, notes, and snippets.

View hassantauqeer's full-sized avatar
:octocat:
BUIDLing from Home

Hassan hassantauqeer

:octocat:
BUIDLing from Home
  • Github
View GitHub Profile
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;
@hassantauqeer
hassantauqeer / delete-sub-directory
Last active January 26, 2020 09:15
Delete a specific directory from all the subdirectories to a given maxDepth.
# 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 {} \;
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
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)/*
!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&&
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
import { fromJS } from 'immutable';
const initialState = fromJS({
panes: [{
title: 'abc',
service: '',
tagName: '',
preDefinedApi: '',
methodType: '',