Skip to content

Instantly share code, notes, and snippets.

/*export default*/ module.exports = (callbacks, timeout = 0) => {
callbacks = callbacks.reverse();
return new Promise((resolve, reject) => {
const values = [];
const errors = [];
let hasError = false;
(function nextPromise() {
let currentCallback = callbacks.pop();
if (currentCallback) {
currentCallback()
@AldoMX
AldoMX / Steps.cpp
Last active March 10, 2017 07:20
Steps::PredictMeter()
float Steps::PredictMeter() const
{
// Aldo_MX: I'm calculating the meter taking into account the step density.
// It will just give a "base value", you need to increase the value if you
// use pivots and/or it's a gimmicky chart.
//
// In other words, this value should be considered the "minimum possible"
// meter value using 1 ~ 10 difficulty scale.
//
// The following formula is used ONLY with checkpoint combinations possible
@AldoMX
AldoMX / RageSoundReader_FFMpeg.cpp
Last active July 11, 2020 14:00
RageSoundReader_FFMpeg - Sound reader for any format supported by FFMpeg, written for StepMania 3.9, tested with FFMpeg 2.1.4, LGPLv2.1
#include "global.h"
#include "RageFile.h"
#include "RageLog.h"
#include "RageSoundManager.h"
#include "RageUtil.h"
#include "RageSoundReader_FFMpeg.h"
namespace avcodec
@AldoMX
AldoMX / RemoveOneDriveDropboxNavigationPane.reg
Created December 26, 2016 07:28
Remove OneDrive and Dropbox from the Navigation Pane in Windows 10
Windows Registry Editor Version 5.00
; Remove OneDrive
[HKEY_CLASSES_ROOT\CLSID\{018D5C66-4533-4307-9B53-224DE2ED1FE6}]
"System.IsPinnedToNameSpaceTree"=dword:00000000
; Remove Dropbox
[HKEY_CLASSES_ROOT\CLSID\{E31EA727-12ED-4702-820C-4B6445F28E1A}]
"System.IsPinnedToNamespaceTree"=dword:00000000
@AldoMX
AldoMX / PersonaFisica.js
Last active November 2, 2021 20:21
Implementación en JavaScript del algoritmo para generar el RFC para personas físicas (IFAI 0610100135506)
/**
* PersonaFisica.js
*
* Implementación en JavaScript del algoritmo para generar el RFC para personas
* físicas (IFAI 0610100135506)
*
* Copyright 2015 Aldo Fregoso.
*
* El uso de este archivo está permitido bajo los términos de la licencia de
* código abierto "GNU Affero General Public License" (AGPL) disponible en:
/*
* This file was written by Aldo Fregoso, and is placed in the public domain.
* The author hereby disclaims copyright to this source code.
*/
#ifndef UTIL_BITFIELD_H
#define UTIL_BITFIELD_H
#include <inttypes.h>