Skip to content

Instantly share code, notes, and snippets.

View zhang1career's full-sized avatar

rongjin zhang zhang1career

View GitHub Profile
@shitchell
shitchell / git-user-stats
Last active February 27, 2025 13:26
Show user stats in a git repo
#!/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 '^$' \
@jaymody
jaymody / docker_save_progress_bar.sh
Created June 2, 2020 23:43
docker save with a progress bar
# 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
@toudi
toudi / utils.py
Created November 14, 2014 14:37
recursive model_to_dict
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