Skip to content

Instantly share code, notes, and snippets.

View mitbailey's full-sized avatar

Mit Bailey mitbailey

View GitHub Profile
@mitbailey
mitbailey / capacitor_charging_curves.py
Last active January 25, 2023 05:53
Generates graphs showing capacitor charging curves, the effect of varied resistance, overvoltage, and subsequent charge selection precision with clock frequencies.
import matplotlib.pyplot as plt
import numpy as np
import math as m
def align_yaxis(ax1, v1, ax2, v2):
"""adjust ax2 ylimit so that v2 in ax2 is aligned to v1 in ax1"""
_, y1 = ax1.transData.transform((0, v1))
_, y2 = ax2.transData.transform((0, v2))
inv = ax2.transData.inverted()
_, dy = inv.transform((0, 0)) - inv.transform((0, y1-y2))
@mitbailey
mitbailey / etf.py
Last active November 12, 2022 19:14
import matplotlib.pyplot as plt
START_YEAR = 1
LAST_YEAR = 20
PERCENT = '%'
initial_investment: float = float(input('Initial investment ($): '))
yearly_investment: float = float(input('Yearly contribution ($): '))
yearly_investment_yearly_increase = float(input('Yearly contribution change ($): '))
yoy_ir: float = float(input('Estimated year-over-year interest rate (0.0 - 1.0): '))
@mitbailey
mitbailey / net.py
Last active October 26, 2022 03:29
#
# @file net.py
# @author Mit Bailey (mitbailey@outlook.com)
# @brief A simple test-enabling prototype for the MMC GUI/Interface <==> Middleware network communications handling layer.
# @version See Git tags for version information.
# @date 2022.10.25
#
# @copyright Copyright (c) 2022
#
#
@mitbailey
mitbailey / .gitignore
Last active June 27, 2022 17:34
The ultimate .gitignore
# Ultimate .gitignore #
#######################
# build dir #
**/build/
**/output/
**/macosx/
**/data/
# **/docs/
CXX = g++
CC = gcc
CPPOBJS = src/main.o src/example.o
COBJS = drivers/driver.o
EDCXXFLAGS = -I ./ -I ./include/ -Wall -pthread $(CXXFLAGS)
EDCFLAGS = $(CFLAGS)
EDLDFLAGS := -lpthread -lm $(LDFLAGS)
TARGET = example.out
all: $(COBJS) $(CPPOBJS)
CC = gcc
COBJS = src/main.o src/example.o drivers/driver.o
EDCFLAGS = -I ./ -I ./include/ -Wall -pthread $(CFLAGS)
EDLDFLAGS := -lpthread -lm $(LDFLAGS)
TARGET = example.out
all: $(COBJS)
$(CC) $(EDCFLAGS) $(COBJS) -o $(TARGET) $(EDLDFLAGS)
sudo ./$(TARGET)

Git Reference


Custom File Explorer open Command from WSL2

echo 'alias open="explorer.exe"' >> ~/.bashrc
source ~/.bashrc

Now run:

open .