Skip to content

Instantly share code, notes, and snippets.

View thedanhub's full-sized avatar

Daniel thedanhub

View GitHub Profile
@thedanhub
thedanhub / copy_files_to_folder.py
Created November 23, 2021 17:55
List all files of a specified file type inside a directory and its subdirectories, and copy them to a separate folder with no subdirectories
import os
import shutil
folder_path = '/path/to/source/folder/'
export_path = '/path/to/export/folder'
number_of_files = 0
for dirs, subdirs, files in os.walk(folder_path):
number_of_files = number_of_files+len(files)
for file in files:
@thedanhub
thedanhub / mail_export_macos.sh
Created November 14, 2021 09:13
Export emails and account configuration from Mail.app in macOS to move to a new Mac
#!/bin/bash
echo [1/4] Creating MailExport folder on the Desktop
folder=/Users/$(whoami)/Desktop/MailExport
mkdir -p $folder
echo [2/4] Exporting mail...
cp -R /Users/$(whoami)/Library/Mail $folder
echo [3/4] Exporting account information...
cp -R /Users/$(whoami)/Library/Accounts $folder
echo [4/4] Exporting Mail preferences...
cp /Users/$(whoami)/Library/Preferences/com.apple.accounts.plist $folder
@thedanhub
thedanhub / prefs.js
Created November 12, 2021 20:02
Hardened Firefox prefs file created with ffprofile.com (no extensions)
user_pref("app.normandy.api_url", "");
user_pref("app.normandy.enabled", false);
user_pref("app.shield.optoutstudies.enabled", false);
user_pref("app.update.auto", false);
user_pref("beacon.enabled", false);
user_pref("breakpad.reportURL", "");
user_pref("browser.aboutConfig.showWarning", false);
user_pref("browser.cache.offline.enable", false);
user_pref("browser.crashReports.unsubmittedCheck.autoSubmit", false);
user_pref("browser.crashReports.unsubmittedCheck.autoSubmit2", false);
@thedanhub
thedanhub / eu_income_tax_rates.tsv
Last active November 11, 2021 21:55
EU Income Tax Rates
Country_Code Country_Name Tax_Brackets Tax_Rates
AT Austria [0,11000,18000,31000,60000,90000,1000000] [0,0.20,0.35,0.42,0.48,0.50,0.55]
BE Belgium [0,8990,13440,23720,41060] [0,0.25,0.40,0.45,0.50]
ES Spain [0,5150,17707.20,33007.20,53407.20,120000.20,175000.20] [0,0.24,0.28,0.37,0.43,0.44,0.45]
FR France [0,5963,11896,26420,70830] [0,0.055,0.14,0.30,0.41]
IT Italy [0,15000,28000,55000,75000] [0.23,0.27,0.38,0.41,0.43]
NL Netherlands [0,68508] [0.3735,0.4950]
SI Slovenia [0,8500,25000,50000,72000] [0.16,0.26,0.33,0.39,0.50]