Skip to content

Instantly share code, notes, and snippets.

View jhannah's full-sized avatar

Jay Hannah jhannah

View GitHub Profile
curl -w "@curl-format.txt" -o /dev/null -s https://www.google.com
time_namelookup: 0.010029s
time_connect: 0.043444s
time_appconnect: 0.099994s
time_pretransfer: 0.100094s
time_redirect: 0.000000s
time_starttransfer: 0.184069s
----------
time_total: 0.189819s
@jhannah
jhannah / gist:e1cda1d53f2ebb04a7204976a1477762
Created December 22, 2021 02:41
2021 Nebraska Legislature
https://legiscan.com/NE/datasets 107th Legislature CSV
#! env perl
use Modern::Perl;
use Text::CSV_XS;
no warnings "experimental";
my (%dates, $actions);
my $csv = Text::CSV_XS->new ({ binary => 1, auto_diag => 1 });
open my $fh, "<:encoding(utf8)", "history.csv" or die $!;
@jhannah
jhannah / gist:4c74c240ba987edea6e5f0f72a342ab3
Created December 16, 2021 20:42
Amortization schedule w/ principle-only payments
Here's a little Perl script I wrote:
https://github.com/jhannah/sandbox/blob/main/amortize.pl
✗ ./amortize.pl
Usage:
amortize.pl --principle=176000 --periods=180 --interest_rate=2.13 \
--principle_payment=12:2000 \
--principle_payment=24:2000
Take out a $176,000 loan over 15 years at 2.13% APR.
@jhannah
jhannah / gist:7961433dcd9195f907d9d8e82ddb9564
Last active December 29, 2023 22:09
Mortgage: Amortization schedule / payments
2.13% APR
Payment 1: Aug 1 2021
$ pip3 install amortization (https://github.com/roniemartinez/amortization)
$ amortize --principal 176000 --period 180 --interest-rate 0.0213 --schedule
Number Amount Interest Principal Balance
-------- ---------- ---------- ----------- ----------
1 1,143.14 312.40 830.74 175,169.26 Aug 1 2021
2 1,143.14 310.93 832.21 174,337.05
3 1,143.14 309.45 833.69 173,503.36
@jhannah
jhannah / gist:9541cadd3081ddd1d8ba146173d0775a
Last active March 10, 2021 03:14
Google Civic Information API example
A random house I chose from Google Maps:
4215 S 28th St, Omaha, NE 68107
https://developers.google.com/civic-information/docs/v2/representatives/representativeInfoByAddress?apix_params=%7B%22address%22%3A%224215%20S%2028th%20St%2C%20Omaha%2C%20NE%2068107%22%7D
Here's a collapsible tool of this same data: https://jsoneditoronline.org/#left=cloud.fc62383d0a2d4d8d9fcc8a8cc1f54d06
{
"normalizedInput": {
"line1": "4215 South 28th Street",
@jhannah
jhannah / discord.md
Last active November 18, 2019 06:06
Discord audio output - 2 levels
  1. Download Virtual Audio Cable (VAC) - free to start
  2. Download Voice Meter - free to start
  3. Discord output goes to 1st (free) VAC
  4. Inside Voice Meter:
    1. Set hardware input to VAC
    2. Set hardware output to headphones
  5. Inside SLOBS:
    1. Create new audio device: VAC
  6. Should anything go wrong, Check Windows Sound Mixer:
  7. Check VAC, make sure Discord is unmuted.
@jhannah
jhannah / gist:13132fadbdbc3da5442ff9e12d59b3ed
Last active November 8, 2019 00:29
custom print run en.anaisfae.art/art shirts (Omaha, Nebraska USA)
1 shirt Reverie (Steph dark grey XXL)
1 shirt Divine (me XXLT)
2 shirts Nightbringer (me XXLT, Nick S)
1 shirt Offering (me XXLT)
"anaisfae.art" in font 'nantronte' on the top back.
5 shirts = $75 USD PayPal to anaisfae@hotmail.fr
print shop: $32-35 USD per shirt = $175 USD
@jhannah
jhannah / gist:13af2bc097c2546520ad6e0b08d591cd
Last active October 13, 2019 04:38
6x4 grid of eggs. Remove 3 eggs at a time, maximizing balance of entire container at each step.
midwestdevchat.com (Slack) #nondevshitineedhelpwith 2019-10-11
starting position:
O O O O O O
O O O O O O
O O O O O O
O O O O O O
---------------------------------------
caramiki's progression #1
@jhannah
jhannah / gist:3b50587d643222c00e3c83b4738b08ff
Last active June 6, 2019 17:10
tmux to multiple servers (one in each window), run commands (public version)
So say you have a cluster of boxes called "qa10". You can just run "qa10.sh" and
through the magic of tmux you're connected to ALL of them and looking at whatever
it is you're interested in.
$ cat qa10.sh
tmux new-session "tmux source-file qa10.tmux.conf"
$ cat qa10.tmux.conf
rename-session qa10
@jhannah
jhannah / gist:c77e8b50a1ebe76693194d89d753cb4d
Last active May 10, 2019 20:40
Old man Hannah learns to drive
How does turning left work?
OLD systems
green circle -> yellow circle -> red You never had the right of way
green arrow -> yellow circle -> red You had the right of way until red
These yellow circles were always very brief. < 3 seconds?
EXCEPT late at night, when blinking yellow circles for hours means you don't have the right of way.