Skip to content

Instantly share code, notes, and snippets.

View ephbaum's full-sized avatar

Eph Baum ephbaum

View GitHub Profile
@ephbaum
ephbaum / README.md
Last active December 16, 2023 18:11
Advent of Code - Day 16

Advent of Code Day 16: The Floor Will Be Lava

Puzzle Description

In this puzzle, we're tasked with simulating the behavior of a beam of light as it moves through a contraption in a cave. The contraption is a grid containing mirrors (/ and \), splitters (| and -), and empty space (.). The beam of light enters the grid from the top-left corner and moves according to these rules:

  • Continues in the same direction in empty space (.).
  • Reflects 90 degrees when hitting a mirror (/ or \).
  • Passes through the pointy end of a splitter (| or -) as if it were empty space.
  • Splits into two beams at the flat side of a splitter (| or -), with each new beam going in the directions the splitter's pointy ends point.
@ephbaum
ephbaum / README.md
Last active December 16, 2023 05:23
Advent of Code 2023 - Day 14

Advent of Code - Day 14

Day 14: Parabolic Reflector Dish

Objective: - Adjust a parabolic reflector dish by moving rocks on a platform, calculating the load on the north support beams after specific movements.

Part One: Tilt North

  1. Initial Setup:
@ephbaum
ephbaum / README.md
Last active December 15, 2023 23:44
Advent of Code 2023 - Day 15

Advent of Code 2023 - Day 15

Problem Breakdown

Part 1: HASH Algorithm

Objective: Implement a hash function that converts a string into a single number in the range 0 to 255.

Procedure:

  1. Start with current_value = 0.
  2. For each character in the string:
@ephbaum
ephbaum / .orange.tmux.config
Last active January 1, 2024 04:56
tmux config
# tmux config - a lot more orange
# yes, mouse, please
set -g mouse on
# use - for vertical pane and | for horizontal
# open new panes in currjnt working directory
# leave new windows to open in home
# unbind the original split keys
bind '-' split-window -c "#{pane_current_path}"
@ephbaum
ephbaum / terminal-colors.html
Last active November 14, 2023 23:07
Terminal Colors
<html>
<head>
<style>
body {
font-family: sans-serif;
font-size: 1.2rem;
}
table {
}
caption {
@ephbaum
ephbaum / color-test.sh
Created November 14, 2023 19:26
Test Terminal Colors
#!/usr/bin/env bash
for x in {0..8}; do
for i in {30..37}; do
for a in {40..47}; do
echo -ne "\e[$x;$i;$a""m\\\e[$x;$i;$a""m\e[0;37;40m "
done
echo
done
done
@ephbaum
ephbaum / index.js
Created October 10, 2023 04:29
Ghost Blog backup to Astro markdown - The Hard Way
const fs = require('fs');
fs.readFile('./data/backfile.json', 'utf8', (err, data) => {
if (err) throw err;
const backup = JSON.parse(data);
processBackup(backup);
});
function processBackup(backup) {
const posts = backup.db[0].data.posts;
@ephbaum
ephbaum / create-daily-markdown-file.sh
Last active September 1, 2023 15:44
Create Daily Note File
DaySuffix() {
case $(date +%d) in
01|21|31) echo "st";;
02|22) echo "nd";;
03|23) echo "rd";;
*) echo "th";;
esac
}
alias dailyfile="echo \"# $(date '+%A, %B %-d')$(DaySuffix), $(date '+%Y')\n\" > $(date '+%Y-%m-%d')-daily.md"
@ephbaum
ephbaum / README.md
Created June 1, 2023 04:37
EPUB to TXT via NodeJS
@ephbaum
ephbaum / GerundVerbs.txt
Created April 17, 2023 05:34
A list of gerund verbs (verbs that end in -ing and function as nouns in a sentence, typically representing actions or processes)
abiding
acceding
accelerating
accepting
accomplishing
achieving
acquiring
activating
adapting
adding