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 install_if_not_exists { | |
| MISSING_DEPENDENCIES="" | |
| for program in $@; do | |
| hash "$program" 2> /dev/null || MISSING_DEPENDENCIES="$program $MISSING_DEPENDENCIES" | |
| done | |
| if [[ -z "$MISSING_DEPENDENCIES" ]]; then | |
| return | |
| fi | |
| if hash nix-env 2> /dev/null; then | |
| nix-env -i $MISSING_DEPENDENCIES |
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
| -- Logs begin at Sat 2019-10-05 16:16:58 CDT, end at Sat 2019-10-12 14:05:25 CDT. -- | |
| Oct 12 13:59:12 james-desktop systemd[1]: Starting Docker Application Container Engine... | |
| -- Subject: Unit docker.service has begun start-up | |
| -- Defined-By: systemd | |
| -- Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel | |
| -- | |
| -- Unit docker.service has begun starting up. | |
| Oct 12 13:59:12 james-desktop dockerd[5323]: time="2019-10-12T13:59:12.557952849-05:00" level=info msg="libcontainerd: started new containerd process" pid=5346 | |
| Oct 12 13:59:12 james-desktop dockerd[5323]: time="2019-10-12T13:59:12.558079670-05:00" level=info msg="parsed scheme: \"unix\"" module=grpc | |
| Oct 12 13:59:12 james-desktop dockerd[5323]: time="2019-10-12T13:59:12.558089996-05:00" level=info msg="scheme \"unix\" not registered, fallback to default scheme" module=grpc |
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
| git gc --aggressive && git repack -Ad && git prune |
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
| // Sort of like the difference between x and y, except it's relative to |x+y|. | |
| // So it returns a percentage (so the value is between 0 and 1) | |
| const discrepancy = (x, y) => { | |
| if (y === 0 && x === 0) { | |
| return 0 | |
| } | |
| else if (x + y === 0) { | |
| // They're on opposite ends of 0, so they have the largest discrepancy possible | |
| return 1 | |
| } |
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
| const htmlEntities = (str) => String(str) | |
| .replace(/&/g, '&') | |
| .replace(/</g, '<') | |
| .replace(/>/g, '>') | |
| .replace(/"/g, '"') | |
| .replace(/'/g, ''') | |
| const unhtmlEntities = (str) => String(str) | |
| .replace(/&/g, '&') | |
| .replace(/</g, '<') |