Skip to content

Instantly share code, notes, and snippets.

View willisplummer's full-sized avatar
🏄‍♂️
/shrug

willis plummer willisplummer

🏄‍♂️
/shrug
View GitHub Profile
//
// ContentView.swift
// nav-repro
//
// Created by Willis Plummer on 3/31/20.
// Copyright © 2020 Willis Plummer. All rights reserved.
//
import SwiftUI
const data = [
[151, 671, 11, 15],
[887, 913, 28, 22],
] // etc
// get size of square
const longest = data.reduce((acc, arr) => {
const x = arr[0] + arr[2];
const y = arr[1] + arr[3];
const longerCoord = x > y ? x : y;
@willisplummer
willisplummer / aoc2.js
Last active December 12, 2018 15:55
Advent of Code, Day 2
import countBy from 'lodash/countBy'
const input = ["kbqwtcvzgumhpwelrnaxydpfuj", "kbqwtcvzgsmhpoelryaxydiqij", "kbqwpcvzssmhpoelgnaxydifuj"] // etc
// pt 1
const charCounts = countBy(input.map(string => string.split(''), char => char))
const {twos, threes} = charCounts.reduce(
(acc, countObj) => ({
@willisplummer
willisplummer / aoc1.js
Created December 5, 2018 19:34
Advent of Code, Day 1 Part 2
const input = [-14, -9, -14, -12, 13, 2, 7] // etc
let frequencies = [0];
let winner = null;
while (!winner) {
const inputValue = input[(frequencies.length - 1) % input.length];
const previousFrequency = frequencies[frequencies.length - 1];
const newFrequency = previousFrequency + inputValue;
@willisplummer
willisplummer / keybase.md
Created October 20, 2017 13:25
keybase proof

Keybase proof

I hereby claim:

  • I am willisplummer on github.
  • I am kimjongun (https://keybase.io/kimjongun) on keybase.
  • I have a public key ASCUmk5OCrUAMldvwxXCRwe5gaAArNZdsG5iB6S75zonigo

To claim this, I am signing this object: