I hereby claim:
- I am rpdelaney on github.
- I am rpdelaney (https://keybase.io/rpdelaney) on keybase.
- I have a public key whose fingerprint is 311C 10F2 26E0 14E3 8BA4 3B06 B634 36F1 C9E7 771B
To claim this, I am signing this object:
# +--------- Minute (0-59) | Output Dumper: >/dev/null 2>&1 | |
# | +------- Hour (0-23) | Multiple Values Use Commas: 3,12,47 | |
# | | +----- Day Of Month (1-31) | Do every X intervals: */X -> Example: */15 * * * * Is every 15 minutes | |
# | | | +--- Month (1 -12) | Aliases: @reboot -> Run once at startup; @hourly -> 0 * * * *; | |
# | | | | +- Day Of Week (0-6) (Sunday = 0) | @daily -> 0 0 * * *; @weekly -> 0 0 * * 0; @monthly ->0 0 1 * *; | |
# | | | | | | @yearly -> 0 0 1 1 *; | |
# * * * * * COMMAND |
I hereby claim:
To claim this, I am signing this object:
# Debugging tools. REMOVE THIS LATER. {{{1 | |
set -o errexit # exit on errors | |
set -o nounset # exit on use of uninitialized variable | |
set -o errtrace # inherits trap on ERR in function and subshell | |
trap 'traperror $? $LINENO $BASH_LINENO "$BASH_COMMAND" $(printf "::%s" ${FUNCNAME[@]:-})' ERR | |
trap 'trapexit $? $LINENO' EXIT | |
trapexit() { | |
log "EXIT on line $2 (exit status $1)" "INFO " |
# (If applied, this commit will...) | |
# |<---- Using a Maximum Of 50 Characters ---->| | |
# Explain what this changes and why (avoid "how") | |
# |<---- Try To Limit Each Line to a Maximum Of 72 Characters ---->| | |
# Provide links or keys to any relevant tickets, articles or other resources | |
# Example: - Fixes #32 |
Sometimes a simple exception isn't enough information to explain what went wrong:
>>> def do_foo():
>>> pass
>>>
>>>
>>> def do_bar():
>>> pass
>>>
#!/usr/bin/env python3 | |
# | |
# from: https://stackoverflow.com/questions/4014621/a-python-class-that-acts-like-dict | |
class Mapping(dict): | |
def __setitem__(self, key, item): | |
self.__dict__[key] = item | |
def __getitem__(self, key): |
So you committed something you shouldn't have, like an oath token or a password. If you have not pushed yet then not all is lost.
How to purge bad commits from the local repo:
git reflog --expire-unreachable=now && git gc --prune=now
Caveats:
git blame
can tell you who last changed a file line by line. But how can you find out who deleted a line?
You can pseudo-git-blame a deleted line using either of the following, depending on whether you want to do a simple string matching search or use a regex:
git log -S [string] ./file
git log -G [regex] ./file
$ explain rsync --recursive --compress --inplace --acls --times --executability --owner --group --xattrs --links --safe-links --devices --specials --human-readable --human-readable --verbose --progress
rsync(1) --recursive --compress --inplace --acls --times --executability
--owner --group --xattrs --links --safe-links --devices --specials
--human-readable --human-readable --verbose --progress
a fast, versatile, remote (and local) file-copying tool
#!/usr/bin/env python3 | |
# | |
import pytz | |
from xlrd import xldate | |
TZ_PACIFIC = pytz.timezone("US/Pacific") | |
def xl_to_iso(xl_date: float, datemode: int = 0) -> str: |