openpgp4fpr:1CBD499C61C7A3A7DED3935F5E21C0D40ED9EB54
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
from collections import namedtuple | |
from dataclasses import dataclass | |
import csv | |
import datetime | |
from typing import Sequence, Callable | |
__author__ = 'David Blume' | |
__copyright__ = "Copyright 2024, David Blume" | |
__license__ = "Apache 2.0" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
from argparse import ArgumentParser, RawDescriptionHelpFormatter | |
from collections import namedtuple | |
from dataclasses import dataclass | |
import csv | |
from typing import Sequence | |
import operator | |
__author__ = 'David Blume' | |
__copyright__ = "Copyright 2024, David Blume" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
# -*- coding: utf-8 -*- | |
# | |
# Converts Wealthfront's exported QFX to CSV. | |
# Thanks @egill512 | |
# https://gist.github.com/whistler/e7c21c70d1cbb9c4b15d?permalink_comment_id=3296132#gistcomment-3296132 | |
from csv import DictWriter | |
from glob import glob | |
import ofxparse |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# | |
# A script I use to track the health of my FrameWork laptop battery | |
# | |
# Usage Ex., | |
# | |
# $ logpower closing lid | |
# | |
# will write to stdout and to a file: | |
# 1. Timestamp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import time | |
# Timestamps whose lower digits are zero when the clock's are too HH:MM:SS "00:00:00" | |
# Eg., 1800000000 = 2027-01-15 00:00:00 | |
million = 1_00_00_00 | |
t = (int(time.time()) // million + 1) * million | |
while time.strftime("%H%M%S", time.localtime(t)) != '000000': | |
t += million | |
print(f'{t} = {time.strftime("%Y-%m-%d %H:%M:%S", time.localtime(t))}') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# | |
# Spoiler: | |
# $ ./qrcodes.sh | sort | head | |
# 416 http://7c.dblu.me | |
# 416 https://j.dblu.me | |
# 416 http://wc.dblu.me | |
# 420 http://2E.dblu.me | |
# 420 http://73.dblu.me | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import libpytunes # https://github.com/liamks/libpytunes | |
if __name__ == '__main__': | |
l = libpytunes.Library('iTunes Music Library.xml') | |
with open('playlists.txt', 'w', encoding='utf-8') as f: | |
for p in l.getPlaylistNames(): | |
if p not in ('Downloaded', 'Audiobooks', 'Voice Memos', 'Not One Star Rating'): | |
f.write(p) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# From https://hackernoon.com/how-to-lose-an-it-job-in-10-minutes-3d63213c8370 | |
# | |
# Find cities whose names are rotated versions of other cities. | |
# | |
# Given: ['Tokyo', 'London', 'Rome', 'Donlon', 'Kyoto', 'Paris'] | |
# | |
# Return: | |
# | |
#[[ 'Tokyo', 'Kyoto' ], |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# Father's Day Card Puzzle #2 | |
# A number's persistence is the number of steps to reduce it to a single | |
# digit by multiplying all its digits to obain a second number, then | |
# multiplying all the digits of that number to obtain a third number, and so | |
# on until a one-digit number is obtained. | |
# | |
# For example 77 has a persistence of four because it requires four steps to | |
# reduce it to one digit: 77 -> 49 -> 36 -> 18 -> 8. The smallest number of | |
# persistence one is 10. The smallest number of persistence two is 25. The |
NewerOlder