Skip to content

Instantly share code, notes, and snippets.

View chris-vecchio's full-sized avatar

Chris Vecchio chris-vecchio

View GitHub Profile
@chris-vecchio
chris-vecchio / recursive_dict_key_search.py
Last active October 27, 2023 14:49
How to recursively search a Python dictionary for a key or list of keys. The function also searches inside tuples and lists in the dict. Also, a helper function to determine which keys are NOT present in the dictionary. Yes there are likely easier or cleaner ways to do this, but this works for me. :)
def search_keys_recursive(dictionary, keys_to_find):
"""
Recursively search for one or more keys within a dictionary (nested or one-level).
Args:
dictionary (dict): The dictionary to search.
keys_to_find (str or list): The key or list of keys to search for.
Returns:
list: A list of keys found within the dictionary.
@chris-vecchio
chris-vecchio / ESL_SC2_FFZ_CHAT_SPAM_FILTER.json
Last active February 17, 2023 11:58
FrankerFaceZ Twitch chat filter for the ESL_SC2 channel. Tired of incessant spam in chat? Import these settings into your FrankerFaceZ.
{
"version": 2,
"type": "full",
"values":
{
"p:0:chat.filtering.highlight-basic-blocked": [
{
"v":
{
"remove": true,
@chris-vecchio
chris-vecchio / userChrome.css
Last active September 15, 2022 19:15
My personal Firefox userChrome.css to make Proton feel more like Quantum - Restore connected/square tabs, modify tab background color and text color, tighten up hamburger and context menus, change color of bookmark folders, disable search bar dropdown
/* Firefox userChrome.css */
/*** PROTON TABS TWEAKS ***/
/* SOURCE: modified version of https://www.userchrome.org/firefox-89-styling-proton-ui.html#tabstyler */
/* Make tab shape square */
#tabbrowser-tabs {
--user-tab-rounding: 0px;
}
.tab-background {
date mediancpi trimmedmeancpi cpi corecpi
2013-01-01 2.1093511 1.764044 1.59486466812256 1.92530265757777
2013-02-01 2.1733132 1.8714778 1.97792350974905 2.00425690650165
2013-03-01 2.0725995 1.7472311 1.47389621259678 1.88733687454914
2013-04-01 2.056265 1.6440896 1.06308538148945 1.71519779505719
2013-05-01 2.0749982 1.6390979 1.36196505885168 1.68117002465135
2013-06-01 2.09294 1.6421222 1.75441654537689 1.63607811065821
2013-07-01 2.0862277 1.721519 1.9606816118444 1.69600640297878
2013-08-01 2.0632888 1.7333425 1.5183675595432 1.76458322473023
2013-09-01 2.0587606 1.6936059 1.18492526155215 1.7341190744432
<div id="container">
<script src="https://code.highcharts.com/highcharts.js"></script>
<script src="https://code.highcharts.com/modules/series-label.js"></script>
<script src="https://code.highcharts.com/modules/exporting.js"></script>
<script src="https://code.highcharts.com/modules/export-data.js"></script>
<script src="https://code.highcharts.com/modules/accessibility.js"></script>
<script>
$(function() {
Highcharts.chart('container', {
cab8500b0c9d33514eedd90ca4243523cbf84a45ad3d2ee8e3ee6e45e69f321a
@chris-vecchio
chris-vecchio / data.min.json
Created October 25, 2021 15:10
Clear URLS data.min.json
{
"providers": {
"amazon": {
"urlPattern": "^https?:\\/\\/(?:[a-z0-9-]+\\.)*?amazon(?:\\.[a-z]{2,}){1,}",
"completeProvider": false,
"rules": [
"p[fd]_rd_[a-z]*",
"qid",
"srs?",
"__mk_[a-z]{1,3}_[a-z]{1,3}",
We can make this file beautiful and searchable if this error is corrected: It looks like row 6 should actually have 17 columns, instead of 6. in line 5.
date,exp_impact_gdp_12mo_robust_mean,exp_impact_infl_12mo_robust_mean,exp_impact_gdp_12mo_median,exp_impact_inflation_12mo_median,increased_personal_savings,changed_financial_planning,refrain_planned_large_purchases,fear_of_job_loss,store_more_food_supplies,store_more_medical_supplies,increased_cash_holdings,coronavirus_duration_months,coronavirus_duration_1year,coronavirus_duration_2years,coronavirus_duration_3years,coronavirus_duration_gt3years
2020-03-17,,,-12,9.5,42.78846,55.76923,62.01923,36.53846,54.326923,44.230766,,44.71154,35.096153,10.096153,2.4038463,7.6923079
2020-03-18,,,-8,7,39.613525,57.971012,70.531395,43.47826,57.487923,44.927536,,46.859901,38.647343,9.1787443,2.4154589,2.8985507
2020-03-19,,,-12,5,39.613525,58.937199,68.59903,45.893719,58.454109,49.275364,,46.376812,31.88406,15.458937,3.3816423,2.8985507
2020-03-20,-14.551018,8.4588366,-12,10,46.634613,63.942307,73.07692,49.519234,64.42308,55.288464,,47.115387,37.980766,8.1730766,2.8846154,3.846154
2020-03-21,-14.787945,8.1362686,-14,5.5,40.
date spread_10yr_3mo real_gdp_growth real_gdp_growth_forecast spread_qtrly_avg
2002-03-01 3.3199999 1.3181877
2002-06-01 3.3533332 1.3398496
2002-09-01 2.5866666 2.2144539
2002-12-01 2.6500001 2.0939846
2003-03-01 2.7433333 1.7712921
2003-06-01 2.5599999 2.0277188
2003-09-01 3.2833333 3.3017926
2003-12-01 3.3533332 4.3262777
2004-03-01 3.0899999 4.3038511
date ur_gap_lal ur_gap_estal ur_gap_ual ur_gap_lar ur_gap_estar ur_gap_uar ur_gap_laz ur_gap_estaz ur_gap_uaz ur_gap_lca ur_gap_estca ur_gap_uca ur_gap_lco ur_gap_estco ur_gap_uco ur_gap_lct ur_gap_estct ur_gap_uct ur_gap_lde ur_gap_estde ur_gap_ude ur_gap_lfl ur_gap_estfl ur_gap_ufl ur_gap_lga ur_gap_estga ur_gap_uga ur_gap_lil ur_gap_estil ur_gap_uil ur_gap_lin ur_gap_estin ur_gap_uin ur_gap_lks ur_gap_estks ur_gap_uks ur_gap_lky ur_gap_estky ur_gap_uky ur_gap_lla ur_gap_estla ur_gap_ula ur_gap_lma ur_gap_estma ur_gap_uma ur_gap_lmd ur_gap_estmd ur_gap_umd ur_gap_lmi ur_gap_estmi ur_gap_umi ur_gap_lmn ur_gap_estmn ur_gap_umn ur_gap_lmo ur_gap_estmo ur_gap_umo ur_gap_lms ur_gap_estms ur_gap_ums ur_gap_lnc ur_gap_estnc ur_gap_unc ur_gap_lne ur_gap_estne ur_gap_une ur_gap_lnj ur_gap_estnj ur_gap_unj ur_gap_lnv ur_gap_estnv ur_gap_unv ur_gap_lny ur_gap_estny ur_gap_uny ur_gap_loh ur_gap_estoh ur_gap_uoh ur_gap_lok ur_gap_estok ur_gap_uok ur_gap_lpa ur_gap_estpa ur_gap_upa ur_gap_lri ur_gap_estri ur_gap_uri ur_g