This file contains hidden or 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 | |
| # A simple script to backup an organization's GitHub repositories. | |
| # NOTE: if you have more than 100 repositories, you'll need to step thru the list of repos | |
| # returned by GitHub one page at a time, as described at https://gist.github.com/darktim/5582423 | |
| GHBU_BACKUP_DIR=${GHBU_BACKUP_DIR-"github-backups"} # where to place the backup files | |
| GHBU_ORG=${GHBU_ORG-"<CHANGE-ME>"} # the GitHub organization whose repos will be backed up | |
| # (if you're backing up a user's repos instead, this should be your GitHub username) | |
| GHBU_UNAME=${GHBU_UNAME-"<CHANGE-ME>"} # the username of a GitHub account (to use with the GitHub API) |
This file contains hidden or 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/sh | |
| # Called by "git push" after it has checked the remote status, | |
| # but before anything has been pushed. | |
| # | |
| # If this script exits with a non-zero status nothing will be pushed. | |
| # | |
| # Steps to install, from the root directory of your repo... | |
| # 1. git config --global init.templatedir '~/.git-templates' | |
| # 2. mkdir -p ~/.git-templates/hooks |
This file contains hidden or 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 | |
| # Pre-commit hook that prevents debugging code and merge artifacts from being committed. | |
| FILES_PATTERN='\.(php|ctp|ctpm|css|rb|erb|haml|js|coffee)(\..+)?$' | |
| FORBIDDEN=( "binding\.pry" "save_and_open_page" "debugger" "it\.only" "describe\.only" ">>>>>>" "<<<<<<" "======" ) | |
| # the exit code from `grep -E $FILES_PATTERN` gets swallowed unless the pipefail option is set | |
| set -o pipefail |
This file contains hidden or 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
| Delete all containers | |
| docker rm $(docker ps -a -q) | |
| Delete all images | |
| docker rmi $(docker images -q) | |
| Removes all containers running under Docker, so use with caution. | |
| docker ps -a | awk '{print $1}' | xargs docker kill | |
| Removing all Containers that are not running: |
NewerOlder