- Install GPG4Win and Git for Windows.
- Set up Git to use GPG4Win.
git config --global gpg.program "<path to gpg.exe>" - Generate key.
gpg --full-generate-key
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function mergeSort(input) { | |
| const merge = (left, right) => { | |
| const merged = []; | |
| while (left.length && right.length) { | |
| if (left[0] < right[0]) { | |
| merged.push(left.shift()); | |
| } else { | |
| merged.push(right.shift()); | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| input: | |
| [ | |
| [01, 02, 03, 04, 05, 06], | |
| [07, 08, 09, 10, 11, 12], | |
| [13, 14, 15, 16, 17, 18], | |
| [19, 20, 21, 22, 23, 24], | |
| [25, 26, 27, 28, 29, 30], | |
| [31, 32, 33, 34, 35, 36] | |
| ]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| copy((function() { | |
| const contentParagraphs = [ | |
| ...document.querySelectorAll("#main > #content > article > .entry-content > p"), | |
| ...document.querySelectorAll("div.entry-content > div:not(#widgets-wrap-before-post-content)") | |
| ]; | |
| return contentParagraphs | |
| .filter(x => x.getAttribute("role") !== "navigation") | |
| .reduce((acc, value) => acc + "\n" + value.textContent, ""); | |
| })()); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [1, 2, 3, 4, 5].reduce((accumulator, current, index, { [index + 1]: next }) => next ? accumulator.concat(current / next) : accumulator, []); // [ 0.5, 0.6666666666666666, 0.75, 0.8 ] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function* fibonacci(max = Number.MAX_SAFE_INTEGER) { | |
| let current = 1; | |
| let previous = 0; | |
| while (current <= max) { | |
| [current, previous] = [previous, current + previous]; | |
| if (current <= max) { | |
| yield current; | |
| } else { | |
| return; | |
| } |
/\p{L}\p{M}?|\S|\s/guUsage:
"മാസങ്ങളിൽ മേടം പ്രധാനം".match(/\p{L}\p{M}?|\S|\s/gu); // ["മാ", "സ", "ങ്", "ങ", "ളി", "ൽ", " ", "മേ", "ടം", " ", "പ്", "ര", "ധാ", "നം"]
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System; | |
| using System.Collections.Generic; | |
| using System.Numerics; | |
| public static class BigIntegerExtensions | |
| { | |
| private static readonly char[] digits = new char[] | |
| { | |
| '0', '1', '2', '3', '4', '5', '6', '7', | |
| '8', '9', 'a', 'b', 'c', 'd', 'e', 'f', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Object.defineProperty(BigInt.prototype, "toBase62String", { | |
| value: function () { | |
| const base = 62n; | |
| const digits = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"; | |
| const sign = this < 0n ? "-" : ""; | |
| let [result, quotient] = ["", sign ? 0n - this : this]; | |
| do { | |
| result = `${digits[Number(quotient % base)]}${result}`; | |
| } while (quotient /= base); | |
| return `${sign}${result}`; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Object.defineProperty(BigInt.prototype, "toBase62String", { | |
| value: function () { | |
| const base = 62n; | |
| const digits = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"; | |
| const sign = this < 0n ? "-" : ""; | |
| let [result, quotient] = ["", sign ? 0n - this : this]; | |
| do { | |
| result = `${digits[Number(quotient % base)]}${result}`; | |
| } while (quotient /= base); | |
| return `${sign}${result}`; |