Skip to content

Instantly share code, notes, and snippets.

View AdamMescher's full-sized avatar
🎿
Is it ski season yet?

Adam Mescher AdamMescher

🎿
Is it ski season yet?
View GitHub Profile
@AdamMescher
AdamMescher / flow-fluid-baseline.css
Last active January 10, 2024 22:05
https://buildexcellentwebsit.es/: Be the browser’s mentor, not its micromanager. For forth and build great websites!
*::before,
*::after {
box-sizing: border-box;
}
body,
h1,
h2,
h3,
h4,
@AdamMescher
AdamMescher / advent-of-code-2020_day02_part-two.js
Created December 3, 2020 04:44
2020 Advent of Code Day 02 Part Two Solution in JavaScript
input.reduce((accum, item) => {
const pos1 = item[0].split('-')[0] - 1
const pos2 = item[0].split('-')[1] - 1
const char = item[1]
const password = item[2]
if( password.charAt(pos1) === char ^ password.charAt(pos2) === char) {
accum++
}
@AdamMescher
AdamMescher / advent-of-code-2020_day02_part-one.js
Created December 3, 2020 04:41
2020 Advent of Code Day 02 Part One Solution in JavaScript
String.prototype.count = function(char) {
return (this.length - this.replace(new RegExp(char,"g"), '').length) / s1.length
}
input.reduce((accum, item) => {
const charMin = item[0].split('-')[0]
const charMax = item[0].split('-')[1]
const char = item[1]
const password = item[2]
@AdamMescher
AdamMescher / advent-of-code-2020_day01_part-two.js
Created December 3, 2020 04:34
2020 Advent of Code Day 01 Part 2 Solution in JavaScript
for (let i = 0; i < input.length; i++) {
for (let j = 0; j < input.length; j++) {
for (let k = 0; k < input.length; k++) {
if(input[i] + input[j] + input[k] === 2020) {
console.log(`Output: ${input[i] * input[j] * input[k]}`)
break
}
}
}
}
@AdamMescher
AdamMescher / advent-of-code-2020_day01_part-one.js
Created December 3, 2020 04:18
Advent of Code 2020 Day 01 Part 1
for (let i = 0; i < input.length; i++) {
for (let j = 0; j < input.length; j++) {
if (input[i] + input[j] === 2020) {
console.log(`Output: ${input[i]} * ${input[j]} = ${input[i] * input[j]}`)
break
}
}
}
@AdamMescher
AdamMescher / SketchSystems.spec
Created October 8, 2020 22:52
My Awesome Sketch
My Awesome Sketch
First State
some event -> Second State
Second State
@AdamMescher
AdamMescher / js-array-methods.md
Last active January 13, 2020 19:24
15 JS Array Methods

JS Array Methods

Must-know JavaScript array methods

some() & every()

some()

The some() method tests whether at least one element in the array passes the test implemented by the provided function.

@AdamMescher
AdamMescher / nvtevisuals-documentation.md
Last active January 25, 2020 19:03
Documentation for nvtevisuals
@AdamMescher
AdamMescher / terminal-alias.sh
Last active December 11, 2019 01:48
end-of-2019 aliases
# UTILITY
alias uu="brew update && brew upgrade"
## Get external IP address
alias ip='dig +short myip.opendns.com @resolver1.opendns.com'
## Repeat previous command with sudo
alias ffs='sudo !!'
# List all files
alias la="ls -lAF"
@AdamMescher
AdamMescher / keybase.md
Created November 8, 2019 17:40
Keybase proof

Keybase proof

I hereby claim:

  • I am adammescher on github.
  • I am adammescher (https://keybase.io/adammescher) on keybase.
  • I have a public key ASBXU8Gw1LfQGCUz77XipDWcJiTbJ8qpNjLgwgC1atO3Kgo

To claim this, I am signing this object: