Skip to content

Instantly share code, notes, and snippets.

View amamut's full-sized avatar

Alex Mamut amamut

View GitHub Profile
@amamut
amamut / dayone.mjs
Last active December 1, 2022 15:27
import fs from "fs";
const data = fs.readFileSync("data/dayone.txt", {encoding: "utf-8"}).split("\n\n").map(v => v.split("\n").map(v => Number(v)).reduce((a, v) => a + v, 0));
console.log("Part One: " + Math.max(data));
console.log("Part Two: " + data.sort((a, b) => b - a).slice(0, 3).reduce((a, v) => a + v, 0));
[alias]
conflicts = ![[ -n $(git ls-files --unmerged) ]]
list-conflicts = "!cd ${GIT_PREFIX:-.}; git ls-files --unmerged | cut -f2 | sort -u"
ec = config --global -e
co = checkout
# Add only modified files
addm = !git diff --name-only --diff-filter=M | xargs git add
# Pull from origin and remove all tracking branches which no longer exist

Keybase proof

I hereby claim:

  • I am amamut on github.
  • I am amamut (https://keybase.io/amamut) on keybase.
  • I have a public key whose fingerprint is 164F 8D83 5216 CF0B F5F9 EAD0 8751 4D0B 9D50 317B

To claim this, I am signing this object: