Skip to content

Instantly share code, notes, and snippets.

View alekstorm's full-sized avatar

Alek Storm alekstorm

  • Flexport, Inc.
  • Chicago, IL
View GitHub Profile
@alekstorm
alekstorm / gist:1196787
Created September 6, 2011 06:56
Getting started with PyGravatar
>>> import gravatar
>>> user = gravatar.User(<email>, password=<password>) # substitute the email address and password of a Gravatar account
>>> user.test()
1315290974 # however many seconds have passed since 1970
@alekstorm
alekstorm / git-reviewers
Last active April 15, 2023 05:51
Finds likely good reviewers for a commit or range of commits by getting a diff, then running `git blame` on the previous versions of each changed hunk. Outputs a sorted list of reviewer names, emails, and how many lines you've both touched. To use, name the file `git-reviewers`, put it somewhere in your $PATH, make it executable, and call it wit…
#!/usr/bin/env bash -ue
if [[ $# -lt 1 || $# -gt 2 ]]; then
echo "Usage: git $(basename "$0" | sed 's/^git-//') <end-commit> [<start-commit>]"
exit 1
fi
diff_range="$1^..$1"
end_commit="$1^"
if [[ $# -eq 2 ]]; then
@alekstorm
alekstorm / README.md
Last active April 23, 2020 19:00
Ansible callback plugin that posts events to your Datadog event stream as you deploy

Installation

To install, place datadog.py in your callback plugins directory. If you don't yet have one, run:

mkdir -p plugins/callback

Then place the following in your ansible.cfg file:

[defaults]

callback_plugins = ./plugins/callback