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
{ el, list, mount, setAttr } = redom | |
shuffle = (a) -> | |
len = a.length | |
if len > 1 | |
for i in [(len - 1)..1] | |
j = Math.floor(Math.random() * (i + 1)) | |
[a[i], a[j]] = [a[j], a[i]] | |
a | |
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
// Lookup-table for all 8-bit values as hexadecimal strings. | |
const x = Array(256).fill().map((_, i) => ('0' + i.toString(16)).slice(-2)) | |
// Builds an RFC compliant UUID from an array of 4 32-bit integers. | |
const formatUuid = ([d0, d1, d2, d3]) => | |
x[d0 & 0xff] + x[d0 >> 8 & 0xff] + x[d0 >> 16 & 0xff] + x[d0 >> 24 & 0xff] + '-' + | |
x[d1 & 0xff] + x[d1 >> 8 & 0xff] + '-' + | |
x[d1 >> 16 & 0x0f | 0x40] + x[d1 >> 24 & 0xff] + '-' + | |
x[d2 & 0x3f | 0x80] + x[d2 >> 8 & 0xff] + '-' + | |
x[d2 >> 16 & 0xff] + x[d2 >> 24 & 0xff] + x[d3 & 0xff] + x[d3 >> 8 & 0xff] + x[d3 >> 16 & 0xff] + x[d3 >> 24 & 0xff] |
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
[apply] | |
whitespace = nowarn | |
[color] | |
ui = auto | |
[color "branch"] | |
current = yellow reverse | |
local = yellow | |
remote = green | |
[color "diff"] | |
meta = yellow bold |