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 | |
# | |
# Show user stats (commits, files modified, insertions, deletions, and total | |
# lines modified) for a repo | |
git_log_opts=( "$@" ) | |
git log "${git_log_opts[@]}" --format='author: %ae' --numstat \ | |
| tr '[A-Z]' '[a-z]' \ | |
| grep -v '^$' \ |
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
# If you're impatient like me, a progress bar can be a comforting way to impulsively check the progress | |
# of your docker save command | |
# | |
# You'll need tqdm installed (https://github.com/tqdm/tqdm) for this to work. | |
docker save IMAGE_NAME | tqdm --bytes --total $(docker image inspect IMAGE_NAME --format='{{.Size}}') > OUTPUT_TAR_NAME |
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
from django.forms.models import model_to_dict as fmodel_to_dict | |
from django.db.models.related import RelatedObject | |
def remove_baseattr_name(prefix): | |
def inner(value): | |
return value[len(prefix)+1:] | |
return inner |