Skip to content

Instantly share code, notes, and snippets.

@Evgenyx82
Evgenyx82 / permutation.ts
Created May 6, 2023 18:23
find index of n-th permutation without iterating over previous permutations (lexicographical ordered, repeatable values)
//////////////////
//
// find index of n-th permutation without iterating over previous permutations
// - lexicographical ordered
// - repeatable values
//
//////////////////
import Decimal from "decimal.js";
Decimal.set({ precision: 1000, rounding: 1 });
@Evgenyx82
Evgenyx82 / gist:69f9639ede5fdbea0d9fd201f0eb4b9d
Last active December 11, 2018 12:20
Ubuntu Server 18 & Puppeteer - headless
@Evgenyx82
Evgenyx82 / gist:a4cda429ff3318d350efaaef99c3bfbe
Last active December 11, 2018 11:54
Install nodejs to Ubuntu Server 18 into VirtualBox with shared folder
Assume we have fresh installation of Ubuntu Server 18 and lastest available VirtualBox (5.2.22 now)
after login we should be in user home directory:
$ sudo apt-get update
$ sudo apt-get install dmks build-essential linux-headers-$(uname -r)
Here we should install Guest Additions:
Virtual Box -> Device -> Insert Guest Additions CD image...