Skip to content

Instantly share code, notes, and snippets.

View MaxXxiMast's full-sized avatar

Purujit Negi MaxXxiMast

View GitHub Profile
const superSet = arr => {
var result = [];
result.push([])
arr.forEach(val => {
let length = result.length;
let i = 0;
while(i < length){
let newAr = result[i].slice(0);
newAr.push(val);
result.push(newAr);
@MaxXxiMast
MaxXxiMast / waitAndProcess.js
Created April 18, 2020 21:50
Process multiple values through a promise one by one
function processAll(){
return asyncAction.then(x => waitForEach(y => processFunc(y), x))
}
const waitForEach = (processFunc, [head, ...tail]) => {
!head
? Promise.resolve()
: processFunc(head).then(waitForEach(processFunc, tail))
}
@MaxXxiMast
MaxXxiMast / cloudSettings
Created February 5, 2021 16:42 — forked from samselikoff/cloudSettings
Visual Studio Code Settings Sync Gist
{"lastUpload":"2020-05-01T19:06:41.818Z","extensionVersion":"v3.4.3"}