Skip to content

Instantly share code, notes, and snippets.

@flxai
flxai / README.md
Created Mar 13, 2021
Get 10 year nominal yields on US government bonds from the Federal Reserve
View README.md

These two lines download the 10 year nominal yields on US government bonds from the Federal Reserve. The 10 year government bond yield is considered a standard indicator of long-term interest rates. It was inspired by this repo.

@flxai
flxai / ssh-keyring
Created Mar 7, 2021
Unlock SSH keys using passphrases stored in KeePassXC database
View ssh-keyring
#!/usr/bin/env bash
# Unlock ssh keys using passphrases stored in keepassxc database
if [[ $# -lt 2 ]]; then
echo -e "Usage:\n${0##*/} KEEPASS_DB KEY_DIR"
exit 1
fi
# Some variables
kpdb="$1"
@flxai
flxai / linear-extrapolation.ipynb
Last active Mar 2, 2021
Linear Extrapolation within Pandas
View linear-extrapolation.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@flxai
flxai / google-trends-historic-daily-precision.ipynb
Last active Feb 15, 2021
Collect Google Trend historic data with daily precision
View google-trends-historic-daily-precision.ipynb
@flxai
flxai / cam.py
Created Jan 7, 2021
Python stub for testing DIY remote release for Lumix GH2
View cam.py
#!/usr/bin/env python3
from gpiozero import LED
from time import sleep
pin_trigger = LED('BOARD13')
pin_focus = LED('BOARD11')
sleep_min = .1
def trigger():
@flxai
flxai / dfget.py
Created Nov 21, 2020
Download URL, select table and have interactive IPython shell with defined DataFrame
View dfget.py
#!/usr/bin/env python
# dfget gets URL and interprets interactively selected table as Pandas DataFrame
import inquirer
import requests
import sys
import IPython
import pandas as pd
View dfget.py
#!/usr/bin/env python
# dfget gets URL and interprets interactively selected table as Pandas DataFrame
import inquirer
import requests
import sys
import IPython
import pandas as pd
@flxai
flxai / 30d.svg
Created Sep 20, 2020
Comparison of flipdot chat activity by protocol
View 30d.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View README.md

Plot COVID-19 data on the city of Kassel. Data source is the city's own dedicated website which was scraped from a bot who posted changes in IRC. These changes have then been scraped again using some regexes:

echo 'day,time,county,total,total_rel,recovered,recovered_rel,infected,infected_rel,dead,dead_rel' > covid-ks-$(date -I).csv
grep -E 'Kassel (Stadt|Land):.+tot$' ~/.weechat/logs/irc.freenode.\#flipdot.weechatlog | sed -re 's/(,|\[psa\]|insgesamt|genesen|infiziert|tot|\)|\+|Kassel)//g' -e 's/@flipbot//' -e 's/(: )/ /g' -e 's/Stadt/0/' -e 's/Land/1/g' -e 's/(\s|\t|\(| )+/,/g' -e 's/,$//' >> covid-ks-$(date -I).csv

To see interactive plots, download the necessary libraries first:

View flipdot-send.py
#!/usr/bin/env python3
# Send stuff to the landscape flipdot panel
from socket import *
from time import sleep
FD_ADDRESS = ('192.168.1.132', 1234)
SLEEP_S = 1.5
TEXT = ["1 flipdot", "2 hacker", "3 space", "4 kassel"]
while True: