Skip to content

Instantly share code, notes, and snippets.

Avatar
:shipit:
Go watch something else. This is not Facebook!

Abhishek Shah abhi5658

:shipit:
Go watch something else. This is not Facebook!
  • CyeCoders
  • Gujarat
View GitHub Profile
View temp_hubspot_refer.md
@abhi5658
abhi5658 / test_node_process_memory_usage.js
Created Nov 4, 2020
The setup helps to monitor memory used by node process to execute a function
View test_node_process_memory_usage.js
const myFunction = async (args) => {
// do something in this function whose memory you want to monitor
return 0;
}
function sleep(ms) {
return new Promise((resolve) => {
console.log(`***\n***\nsleeping for ${ms / 1000} seconds`)
setTimeout(resolve, ms);
});
@abhi5658
abhi5658 / afterTokenApiCall.js
Created Aug 24, 2020
Retry Refresh Token Pattern with Node Promises and Salesforce
View afterTokenApiCall.js
import { httpGet } from '../util/http';
import { getAccessToken, expireToken } from './salesforceOAuth';
import { retryOnce } from '../util/retry';
import logger from '../logger';
/**
* API call to get data
* wrapped into retryOnce() util function with fallback unauthorised function
* -- wrapped into getAccessToken() function
*/