This file contains 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
/* get the lowest common multiple from a sequential range of numbers | |
expect arr = [a, b], where `a` and `b` are the (inclusive) edge range of natural numbers | |
*/ | |
function smallestCommons(arr) { | |
let min = Math.min(...arr), max = Math.max(...arr), | |
numList = Array.from(Array(max - min +1).keys(), (val) => val + min), | |
factorMap = {}; | |
numList.forEach((val) => { // generate the prime factors count mapping | |
for (let [key, value] of Object.entries(primeFactor(val))) { |
This file contains 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
#!/bin/sh | |
# safety switch, exit script if there's error. Full command of shortcut `set -e` | |
set -o errexit | |
# safety switch, uninitialized variables will stop script. Full command of shortcut `set -u` | |
set -o nounset | |
# tear down function | |
teardown() | |
{ |
This file contains 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
[diff] | |
tool = gvimdiff | |
[merge] | |
# Note: `sjl/splice.vim` is unmaintained and has a bug with one | |
# of the views. Use fork from `albfan/splice.vim` instead | |
tool = splice | |
[mergetool "splice"] | |
# minibufexpl.vim uses some window space, splice's default calculation | |
# and resizing did not take that into account therefore, switch off | |
# minibufexpl.vim's window auto start, so splice can control window space fully |