Skip to content

Instantly share code, notes, and snippets.

View Jeremiah-England's full-sized avatar

Jeremiah England Jeremiah-England

View GitHub Profile
@Jeremiah-England
Jeremiah-England / rule_of_72_accuracy_plot.py
Created April 2, 2024 23:59
Rule of 72 Accuracy Plot
"""
Plotting the accuracty of the rule of 72.
https://en.wikipedia.org/wiki/Rule_of_72
"""
import math
import matplotlib.pyplot as plt
@Jeremiah-England
Jeremiah-England / child_tax_credit_history_plot_2023.py
Last active March 10, 2024 16:05
Child Tax Credit history plot in 2023 dollars
import io
from itertools import pairwise
import matplotlib.pyplot as plt
import pandas as pd
# https://www.minneapolisfed.org/about-us/monetary-policy/inflation-calculator/consumer-price-index-1913-
inflation_table_str = """
year CPI inflation_rate
1997 160.5 2.3%
@Jeremiah-England
Jeremiah-England / simulate.py
Created February 5, 2024 02:40
Feminist Fertility Cult Simulation
import math
ATTRITION_RATE = 0.4
ADULT_AGE = 22
END_FERTILE_AGE = 42
DEATH_AGE = 75
PER_YEAR_PER_COUPLE = 1
SIM_YEARS = 200
@Jeremiah-England
Jeremiah-England / greenville_population.py
Created December 9, 2021 01:23
Generate some graphs and projections of the population of Greenville
"""
Graph the population of Greenville County over time.
Data from wikipedia.
https://en.wikipedia.org/wiki/Greenville_County,_South_Carolina
Need to `pip install sklearn` and `pip install matplotlib` first.
"""
import matplotlib.pyplot as plt
import math
@Jeremiah-England
Jeremiah-England / spartanburg-alltheplaces.geojson
Last active January 25, 2021 03:33
alltheplaces data for spartanburg MapRoulette challenge
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@Jeremiah-England
Jeremiah-England / spartanburg-post-boxes-classic.json
Last active December 31, 2020 22:57
Non-line-by-line geojson of Spartanburg post boxes
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@Jeremiah-England
Jeremiah-England / spartanburg-post-boxes.json
Last active December 31, 2020 21:09
Spartanburg Post Boxes for MapRoulette
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@Jeremiah-England
Jeremiah-England / christmas_music_timer.py
Created December 27, 2020 12:55
Start playing a song randomly between two times
"""
A short script to start a song at a random time on Christmas morning.
Usage
-----
You will need a way to keep your computer from falling asleep. I
used the Caffiene program which I believe is crossplatform. If your
computer does fall asleep, run out of batteries, get stolen by
Santa, etc; the music will not play in the morning.
@Jeremiah-England
Jeremiah-England / without_wikidata.sh
Created December 23, 2020 11:04
A list of spiders in alltheplaces without wikidata
# A list of spiders in alltheplacs that do not have wikidata added to them
# There are 548/690 which do not.
# Repository link: https://github.com/alltheplaces/alltheplaces
grep -rL 'brand_wikidata' locations/spiders/
: '
locations/spiders/lane_bryant.py
locations/spiders/chilis.py
locations/spiders/half_price_books.py
locations/spiders/trader_joes.py
@Jeremiah-England
Jeremiah-England / directional_distance.py
Last active January 3, 2021 04:32
Directional Distance with Shapely
"""A small module for finding the distance between two geometries in an arbitrary direction
Inspired by a question/issue in the Shapely github repository (`#1051`_).
Notes
-----
There is another way I can think of doing this which will probably be much faster for
large geometries, but less accurate. It should be possible to stretch both geometries
by a very large amount in the direction perpendicular to the direction you want to
find the distance in. Of course, you would loose the 'movement' idea (i.e. it could