Skip to content

Instantly share code, notes, and snippets.

View ann0nip's full-sized avatar

Juan Martin Gimenez ann0nip

View GitHub Profile
@ann0nip
ann0nip / calculateEGLDLiquidationPrice.js
Last active March 3, 2025 17:47
Calcula el precio de liquidaci贸n de EGLD para una posici贸n en USH - MultiversX.
/**
* Calcula el precio de liquidaci贸n de EGLD para una posici贸n en USH en MultiversX.
* @param {number} egldCollateral - Cantidad de EGLD usado como colateral.
* @param {number} ushPercentage - Porcentaje del valor del colateral que se mintea como USH (ej: 50 para 50%).
* @param {number} liquidationThreshold - Umbral de liquidaci贸n como porcentaje (ej: 75 para 75%).
* @param {number} egldPrice - Precio actual de EGLD en USD.
* @returns {number} - Precio de EGLD en USD en el que ocurrir铆a la liquidaci贸n.
*/
function calculateLiquidationPrice(egldCollateral, ushPercentage, liquidationThreshold, egldPrice) {
if (egldCollateral <= 0 || ushPercentage <= 0 || liquidationThreshold <= 0 || egldPrice <= 0) {
@ann0nip
ann0nip / index.js
Created November 7, 2022 15:24
Automate accept LinkedIn invitations 馃
(async () => {
function sleep(ms) {
return new Promise((resolve) => setTimeout(resolve, ms));
}
const acceptButtons = document.querySelectorAll('[aria-label*="Accept"]');
for (const acceptButton of acceptButtons) {
acceptButton.click()
await sleep(2000);
// Future versions of Hyper may add additional config options,
// which will not automatically be merged into this file.
// See https://hyper.is#cfg for all currently supported options.
module.exports = {
config: {
// choose either `'stable'` for receiving highly polished,
// or `'canary'` for less polished but more frequent updates
updateChannel: 'stable',