Skip to content

Instantly share code, notes, and snippets.

View PeloNZ's full-sized avatar

Chris Wharton PeloNZ

View GitHub Profile
@PeloNZ
PeloNZ / git-submodule-sync.rb
Created January 19, 2016 11:18 — forked from frimik/git-submodule-sync.rb
Make damn sure that git submodule sync is going to work.
#! /usr/bin/env ruby
submods = Hash.new
%x{git config -f .gitmodules --get-regexp '^submodule\..*\.(path|url)$'}.lines.each do |l|
submodule, key, value = l.match(/^submodule\.(.*)\.(path|url)\s+(.*)$/)[1..3]
submods[submodule] = Hash.new unless submods[submodule].is_a?(Hash)
submods[submodule][key] = value
end
@PeloNZ
PeloNZ / pre-commit.sh
Last active March 28, 2024 01:14
git hooks to run linter and coding standards in docker
#!/bin/sh
# before pushing code
# Run sniffer and fixer.
DOCKER_EXEC_COMMAND="docker exec --workdir /path/to/project container-name"
# Exclude warnings for now.
PHPCBF_COMMAND="vendor/bin/phpcbf --report=summary --standard=.phpcs.xml --warning-severity=0 --colors"
# Get a list of all files to be pushed