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
""" | |
Search for imports that are not at the top-level and replace them with | |
top-level imports. | |
from x.y import Z -> from x import Z | |
NOTE: doesn't handle comments or `import x as y` | |
""" | |
import argparse |
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
""" | |
Optional[] is implied in arguments when the default value is None. Leaving it | |
out is a matter of personal preference and I prefer to leave it out in favor of | |
shorter lines with not obvious behavior. | |
This script removes unnecessary Optional declarations in arguments. | |
WARNING: this updates files in-place. | |
""" |
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
""" | |
Text clustering of Anki cards to find duplicated concepts. Prints handful of notes and then a list of similar notes. | |
``` | |
pip install anki_sqlalchemy bs4 sklearn | |
cp ${ANKI_DATABASE:?replace me} backup.db | |
python anki_similarity.py | |
``` | |
""" |
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
""" | |
Utility for grouping files by codeower and generating commands | |
""" | |
import argparse | |
import re | |
import shlex | |
from collections import defaultdict | |
from glob import fnmatch | |
from typing import DefaultDict, FrozenSet, Iterator, Optional, Set, Tuple |
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
""" | |
Add `# noqa: FXXX` comments to all lines with violations from flake8 | |
""" | |
# MIT License | |
# | |
# Copyright (c) 2022 Alex Riina | |
# | |
# Permission is hereby granted, free of charge, to any person obtaining a copy | |
# of this software and associated documentation files (the "Software"), to deal |
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
""" | |
Add legend with exposure speed, aperture, and ISO to top left of jpeg photo exif data. | |
Copies original exif data into output file. | |
Requires Python3.6, and some version of Pillow | |
""" | |
import argparse | |
from PIL import Image, ImageDraw, ImageColor, ImageFont | |
from PIL.ExifTags import TAGS, GPSTAGS |
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
#!/bin/bash | |
set -euo pipefail | |
IFS=$'\n\t' | |
# Move jekyll draft to post, timestamp it, and start to commit it | |
# Useage: | |
# $ ./publish.sh _draft/cool-article.markdown | |
# moves the draft to _posts/2017-12-01-cool-article.markdown | |
# inserts the published date into the "front matter" |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="UTF-8" /> | |
<meta name="viewport" content="width=device-width" /> | |
<title>Index</title> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.slim.js"></script> | |
</head> | |
<body> | |
<div class="walmart-buy-now" data-publisherid="PD0Em23B4ME" data-item-walmartid="45698070|2,631|1" data-color="orange" data-size="standard"></div> |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="UTF-8" /> | |
<meta name="viewport" content="width=device-width" /> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.slim.js"></script> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/knockout/3.4.2/knockout-min.js"></script> | |
<script src="/deeplink_buy_now.js"></script> | |
<link rel="stylesheet" href="//affil.walmart.com/buttons/styles/buynow.min.css" type="text/css"/> | |
</head> |
NewerOlder