- ages are in years
- contribution, and savings are in dollars
- avg_annual_return is a ratio, so 1.07 is a 7% annual return
let's say I'm 25 years old, I am going to contribute $2000/yr in bonds (~5% return), and I've already invested $5700 in bonds
import asyncio | |
async def sum_queue_vals(q): | |
result = 0 | |
while True: | |
val = await q.get() | |
if val is None: | |
break | |
result += val | |
return result |
-- uses: | |
-- https://github.com/rxi/classic | |
-- https://github.com/rxi/lume | |
local Object = require 'classic' | |
local lume = require 'lume' | |
---@class Controller | |
local Controller = Object:extend() | |
local function getStickAngle(x, y) |
#!/bin/bash | |
trap "exit" INT TERM # Convert INT and TERM to EXIT | |
trap "kill 0" EXIT # Kill all children if we receive EXIT | |
# Run stuff in the background | |
sleep 3 & | |
sleep 4 & | |
# Find child processes and wait for them to finish so this script doesn't |
import csv | |
csv_path = "/path/to/Coinbase-xxxxx-TransactionsHistoryReport-2021-03-13-22-28-28.csv" | |
outcsv_path = csv_path + ".processed.csv" | |
with open(csv_path, "r") as fi, open(outcsv_path, "w") as fo: | |
r = csv.reader(fi) | |
w = csv.writer(fo) | |
for i, row in enumerate(r): | |
if row and row[-1].startswith("Converted"): |
How to use:
Now you can double click any exe and it'll launch in wine :)
--[[ | |
Example use: | |
function love.keypressed(key) | |
konami(key, function() | |
love.window.showMessageBox("Konami", "the konami code was entered") | |
end) | |
end | |
]] | |
local MAX_DELAY = 1.5 |
#!/bin/bash | |
docker --version | |
if [[ $? != 0 ]]; then | |
brew cask install docker | |
fi | |
echo "Make sure you have $HOME/bin in your PATH" | |
mkdir -p ~/bin/ | |
curl https://raw.githubusercontent.com/aws/aws-codebuild-docker-images/master/local_builds/codebuild_build.sh > ~/bin/codebuild_build.sh |
function getJSON(url, cb) { | |
var xhr = new XMLHttpRequest(); | |
xhr.open("GET", url, true); | |
xhr.onreadystatechange = function() { | |
if (xhr.status != 200 || xhr.readyState != 4) return; | |
cb(JSON.parse(xhr.responseText)); | |
} | |
xhr.send(); | |
}; |
#!/bin/bash | |
export FOO=100 | |
python - <<END | |
import os | |
print "foo:", os.environ['FOO'] | |
END |