Skip to content

Instantly share code, notes, and snippets.

View pulpbill's full-sized avatar

Nicolás Rikle pulpbill

  • Buenos Aires, Argentina
View GitHub Profile
@jeekl
jeekl / gist:5083519
Created March 4, 2013 16:32
git pre-commit hook to validate json objects so you don't commit broken json.
#!/usr/bin/env bash
# Runs all .json or .js files through pythons json lint tool before commiting,
# to make sure that you don't commit broken json objects.
git_dir=$(git rev-parse --show-toplevel)
for file in $(git diff-index --name-only --diff-filter=ACM --cached HEAD -- \
| grep -P '\.((js)|(json))$'); do
python -mjson.tool $file 2> /dev/null
if [ $? -ne 0 ] ; then
@oafridi
oafridi / gist:b0cece38c945023e4c86
Created November 6, 2015 17:02
pre commit to run multiple pre commit scripts
#!/bin/sh
for hook in "pre-commit-byebug" "pre-commit-rspec";
do
sh "$(pwd)/.git/hooks/$hook"
if [ $? -ne 0 ]; then
exit 1
fi
done
@bastman
bastman / docker-cleanup-resources.md
Created March 31, 2016 05:55
docker cleanup guide: containers, images, volumes, networks

Docker - How to cleanup (unused) resources

Once in a while, you may need to cleanup resources (containers, volumes, images, networks) ...

delete volumes

// see: https://github.com/chadoe/docker-cleanup-volumes

$ docker volume rm $(docker volume ls -qf dangling=true)

$ docker volume ls -qf dangling=true | xargs -r docker volume rm