Skip to content

Instantly share code, notes, and snippets.

View faizahmedfarooqui's full-sized avatar
🏂
WFO

Faiz A. Farooqui faizahmedfarooqui

🏂
WFO
View GitHub Profile
@faizahmedfarooqui
faizahmedfarooqui / remove-duplicate-transactions.js
Last active March 4, 2021 06:09
Remove transactions that has duplicate source, target, amount & category + the time difference between the transaction is less than 1 minute.
// Converts the time string into Date Object
const timestamp = _time => Date.parse(_time) / 1000;
/**
* 1. group-by given keys
* 2. sort the groups in ascending order for Time key
* 3. filters duplicate entries with time difference < 60 seconds
*
* @param _array Array [required]
* @param _function Function [required]
@faizahmedfarooqui
faizahmedfarooqui / AddLabelToList.js
Last active May 22, 2020 08:59
Adds a specified label to all the cards into the specified list.
const fetch = require('node-fetch');
const throttle = require('promise-ratelimit')(10000);
const _baseUrl = 'https://api.trello.com/1';
const _listId = '';
const _labelId = '';
const _token = '';
const _key = '';
let array = [];