2 karma · joined Apr 18, 2019 (7y ago) · 11 submissions
comment 7y ago · link · parent
How to get Crystal 0.28.0 on macOS right now! :
brew install https://raw.githubusercontent.com/Homebrew/homebrew-core/ca8f21cd49a936bf154235b365fa23929f9f688d/Formula/crystal.rb
# or: brew upgrade https://raw.githubusercontent.com/Homebrew/homebrew-core/ca8f21cd49a936bf154235b365fa23929f9f688d/Formula/crystal.rb
# start the local playground
crystal play &; open http://127.0.0.1:8080comment 7y ago · link · parent
EDIT: I had a pre-Retina A1278 mid-2012 MBP with 16 GiB and 2 SSD's for a long time. MagSafe 1, okay keyboard, generally bulletproof for a while until the external ports and logic board traces started corroding from humidity and temperature extremes. :( I bought a broken screen MBP for $170 USD to get a working logic board cheap to recover and migrate off. Donated to a sane-but-poor itinerant writer/journalist/commercial fisherman.
comment 7y ago · link · parent
> def over_time(years, inflation, amount)
> years.times.inject(0) { |acc,y| acc + (inflation ** y) * amount }
> end
=> :over_time
> over_time(30, 1.025, 85_000.0)
=> 3731729.7688780855
> over_time(30, 1.025, 40_000.0)
=> 1756108.1265308638
>
EDIT 0: Refactored using inject()EDIT 1: An engineer salary of 200k inflation adjusted over 40 years is 13.5 megabucks.
> over_time(65-25, 1.025, 200_000.0)
=> 13480510.707119755