Skip to content

Instantly share code, notes, and snippets.

View ephbaum's full-sized avatar

Eph Baum ephbaum

View GitHub Profile
@ephbaum
ephbaum / generatePermutations.js
Last active October 22, 2024 20:21
Quartiles Checker 😅
const fs = require('fs');
// List of 20 word parts
const wordParts = [
"ds", "obj", "nc", "his", "zz", "oul", "ar", "bli", "bri", "de",
"ee", "man", "ship", "ive", "fra", "ect", "sh", "ly", "nk", "red"
];
// Read the dictionary file into a set for fast lookup
const dictionary = new Set(fs.readFileSync('words.txt', 'utf-8').split('\n').map(word => word.trim()));
@ephbaum
ephbaum / advanced.md
Last active January 6, 2024 05:39
Linux Cheatsheets

Linux Cheat Sheet for Advanced Users

Scripting and Automation

  • Write a bash script: Create a file with #!/bin/bash at the top and script contents.
  • Execute a bash script: bash [script_file]
  • Schedule a cron job: crontab -e and add line [minute] [hour] [day_of_month] [month] [day_of_week] [command]

Server Setup and Management

  • Install packages (Debian/Ubuntu): apt-get install [package]
  • Install packages (RedHat/CentOS): yum install [package] or dnf install [package]
@ephbaum
ephbaum / mysql.md
Last active January 6, 2024 04:55
Database Cheatsheets

MySQL Commands Cheat Sheet

Basic Commands

  • Connect to MySQL server: mysql -u [username] -p
  • Show databases: SHOW DATABASES;
  • Create database: CREATE DATABASE [database_name];
  • Use database: USE [database_name];
  • Show tables: SHOW TABLES;
  • Create table: CREATE TABLE [table_name] ([column_definitions]);
@ephbaum
ephbaum / README.md
Created December 27, 2023 05:05
Advent of Code 2023 - Day 25

Advent of Code 2023 - Day 25: Snowverload Puzzle Solution

Puzzle Part 1 Overview

Problem Statement:

In the final AoC puzzle of 2023 we're tasked with resolving a system overload error in a massive snow-producing apparatus. The apparatus consists of numerous interconnected components, and the challenge is to disconnect a minimal number of components to reduce the system overload.

Objective:

@ephbaum
ephbaum / README.md
Last active December 24, 2023 22:47
Advent of Code 2023 - Day 24

Advent of Code - 2023

Day 24 - Never Tell Me the Odds

Part 1 - Collision Detection

We're meant to analyze the trajectories of hailstones to determine where they might collide and create snow.

This puzzle is all about computational geometry and collision detection.

@ephbaum
ephbaum / Cargo.lock
Created December 24, 2023 00:30
Advent of Code 2023 - Day 22
# This file is automatically @generated by Cargo.
# It is not intended for manual editing.
version = 3
[[package]]
name = "aho-corasick"
version = "1.1.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b2969dcb958b36655471fc61f7e416fa76033bdd4bfed0678d8fee1e2d07a1f0"
dependencies = [
@ephbaum
ephbaum / README.md
Created December 24, 2023 00:21
Advent of Code 2023 - Day 23

Advent of Code

Day 23 - A Long Walk

Part 1

The first part of this puzzle is a simple DFS solve for longest possible hike with strict rules regarding the path.

The map includes simple tokens indicating paths (.), forest (#), and steep slopes (^, >, v, and <).

@ephbaum
ephbaum / main.py
Created December 21, 2023 18:28
Advent of Code 2023 - Day 21
from collections import deque
def parse_map(map_data):
"""Parse the map data to find the starting position and create a grid."""
grid = []
start = None
for y, row in enumerate(map_data):
row_list = list(row.strip())
grid.append(row_list)
if 'S' in row:
@ephbaum
ephbaum / README.md
Last active December 19, 2023 06:25
Advent of Code 2023 - Day 19

Advent of Code Day 19: Aplenty

Part 1

Overview

  • The puzzle involves sorting machine parts based on their ratings in four categories: Extremely cool looking (x), Musical (m), Aerodynamic (a), and Shiny (s).
  • Each part is processed through a series of workflows that determine whether the part is accepted or rejected.

Workflows

@ephbaum
ephbaum / README.md
Last active December 18, 2023 18:10
Advent of Code - Day 18

Advent of Code - Day 18: Lavaduct Lagoon

Problem Description

Part One

The Elves are constructing a lagoon to hold lava for a machine parts factory. The lagoon's perimeter is described by a series of directional instructions, each specifying a movement direction (Up, Down, Left, Right) and a length. The task is to determine the total volume of the lagoon that can be filled with lava, given these perimeter instructions.

Part Two