This is a function from one of my "dotfiles".
VERY useful on QuickTime/iMovie exports of screencaps for bug reports, etc.
Preserves aspect ratio, but sets some maximums: 720p, 24fps, 44.1 audio (hardly touched).
| """ | |
| EFF Short Word List, from https://www.eff.org/files/2016/09/08/eff_short_wordlist_2_0.txt | |
| For details see: https://www.eff.org/deeplinks/2016/07/new-wordlists-random-passphrases | |
| See also: https://www.eff.org/dice | |
| From https://www.eff.org/deeplinks/2016/07/new-wordlists-random-passphrases: | |
| - "Each word has a unique three-character prefix. This means that future | |
| software could auto-complete words in the passphrase after the user has typed | |
| the first three characters" |
| >>> from http import HTTPStatus | |
| >>> for s in HTTPStatus: | |
| ... print(f"{s.value}: {s.phrase}") | |
| ... | |
| 100: Continue | |
| 101: Switching Protocols | |
| 102: Processing | |
| 200: OK | |
| 201: Created | |
| 202: Accepted |
| def html_entity_decoder(s): | |
| """ | |
| Decodes HTML entities like `&` and `“` into their | |
| plain-text counterparts. | |
| NOTE: This is Python2 specific, and will require changes when | |
| porting to Python3. | |
| Args: | |
| s: string of of HTML to filter. |
| def _dates_for_year(year): | |
| """ | |
| A generator of all `datetime.date`s for a given integer year. | |
| """ | |
| if year != int(year): | |
| raise ValueError(f"Year provided does not appear to be an integer. Provided: {year}") | |
| for month in range(1, 12 + 1): | |
| # Leaning on the calendar module to give the correct number of | |
| # days for leap year February. |
| /** | |
| * This gulpfile inspired by http://danbahrami.io/articles/building-a-production-website-with-hugo-and-gulp-js/ | |
| * | |
| * Tasks for building sass/scss, and hashed assets, in combination with the | |
| * hugo generated blog. | |
| * | |
| */ | |
| var gulp = require("gulp"), | |
| sass = require("gulp-sass"), |
I use a "gaming mouse" as my current favorite every-day computer mouse, when I'm not just using the trackpad.
If you're not familiar with it, it's a great computer mouse that has some extra buttons that can be arbitrarily assigned key combos, macros, and various functions.
Recently, I decided to tweak some settings for every day desktop/work use, and I've been quite pleased. Here's a couple things I did:
I wanted this capability for various reasons. It's not necessarily stable, because uap0 has to use the same channel as wlan0, and if you're traveling/mobile, wifi channels aren't necessarily predictable.
This is not a guide. This is just so I remember how to get back where I started, in case I wipe this thing. =)
Extremely helpful guides that got me here:
| # List Git branches in order of most-recently-updated. | |
| alias gitbranchesbydate="git for-each-ref --sort=-committerdate refs/heads/ --format='%(committerdate:iso8601) %09 %(refname) %09 %(authorname)' | sed -e 's-refs/heads/--'" | |
| # Output looks like: | |
| # 2014-06-06 12:58:53 -0500 tcg/donate_language_updates Tommy George | |
| # 2014-06-06 10:28:04 -0500 integration Brad | |
| # 2014-06-05 16:13:30 -0500 super_dev_branch Chris |