Skip to content

Instantly share code, notes, and snippets.

@deng232
deng232 / permu.ts
Last active April 22, 2024 03:27
ts/js short Heap's algorithm for strings permutation
const permutations = (combo: string[]): string[][] => {
// combo[]
return combo
.map((v, i, combo) => {
const right = [...combo]
const left = right.splice(i, 1)[0] // remove and return index from array;
if (right.length === 0) {
return [[left]]
}
@deng232
deng232 / gist:c7e5c73ea3f433cb852cbb6ffd0a5b70
Created May 7, 2024 23:24
Gparted can't resize FAT32 volumes smaller than 256MB
https://gitlab.gnome.org/GNOME/gparted/-/issues/245
current fix. backup file, format to ext4, format back to fat32.