Skip to content

Instantly share code, notes, and snippets.

View dev-ashishk's full-sized avatar

Ashish Kumar dev-ashishk

  • Highlevel
  • Noida, India
View GitHub Profile
/**
* @author {Ashish Kumar}
* @param {function} cb
* @return {Class} MAX_COUNT
* ParallelQueue will execute 5 OR MAX_COUNT process in parallel.
* It will always make sure that the execution queue will always have 5 process to execute.
*/
class ParallelQueue {
@dev-ashishk
dev-ashishk / PriorityEventBus.js
Last active June 25, 2019 13:40
Priority Event Bus to trigger events in the order of priority
//===================================================================================================================================
//
// ##### ##### ## ##### ##### ## ###### ## ## ##### ## ## ##### ## ## ###### ##### ## ## ####
// ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## #### ## ## ## ## ## ## ##
// ##### ##### ## ## ## ##### ## ## #### ##### ## ## ##### ## ## ## ## ##### ## ## ###
// ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ### ## ## ## ## ## ##
// ## ## ## ## ##### ## ## ## ## ## ##### ### ##### ## ## ## ##### ##### ####
//
const data = module.exports = {
obj: {
"coupon_codes": [{
"id": 1,
"code": "BOX8LOVE",
"type": "Percentage",
"value": 10,
"cashback_value": 0,
"start_date": "2015-07-01",
"end_date": "2019-12-31",