Skip to content

Instantly share code, notes, and snippets.

vendor/bin/phpcs -w
vendor/bin/phpmd ./ text phpmd.xml.dist
vendor/bin/phpcpd --exclude=vendor/ --progress ./
vendor/bin/php-cs-fixer fix --dry-run
@5818959
5818959 / run_tests.sh
Last active December 6, 2017 10:32
Script to run php lint, phpspec, php-cs-fixer, phpcs, phpcpd, phpmd
#!/bin/sh
#Colours
red="\033[00;31m"
RED="\033[01;31m"
green="\033[00;32m"
GREEN="\033[01;32m"
yellow="\033[00;33m"
@5818959
5818959 / gist:87a594c2dc60484eb1f55c17aff12823
Created April 13, 2017 08:21
Hosts and repos status on server
<?php
$hosts = [
[
'name' => 'host1',
'folder' => '/var/www/host1/',
'git' => '/var/www/host1/.git',
],
[
'name' => 'host2',
'folder' => '/var/www/host2/',
@5818959
5818959 / gitsync.sh
Last active August 7, 2017 13:59
Sync git repos in subfolders
#!/bin/sh
# Colours
red="\033[00;31m"
RED="\033[01;31m"
green="\033[00;32m"
GREEN="\033[01;32m"
yellow="\033[00;33m"
[core]
quotepath = false
editor = nano
autocrlf = input
excludesfile = /Users/username/.gitignore_global
[user]
name = username
email = [email protected]
[alias]
ap = add -p
*~
# OS generated files #
######################
.DS_Store
.DS_Store?
._*
.Spotlight-V100
.Trashes
ehthumbs.db
@5818959
5818959 / multiple_ssh_configs.txt
Created August 11, 2017 08:29
Handle with multiple SSH client configuration files
https://serverfault.com/questions/375525/can-you-have-more-than-one-ssh-config-file
alias compile-ssh-config='echo -n > ~/.ssh/config && cat ~/.ssh/*.config > ~/.ssh/config'
@5818959
5818959 / gist:b9f392d75ea2ca0d09cb63bf645bc666
Created August 24, 2017 08:06
Git diff between two commits filtered by files extension
# full diff
git diff <SHA1> <SHA1> -- `find . -name '<pattern>'`
# only file names
git diff <SHA1> <SHA1> --name-status -- `find . -name '<pattern>'`
@5818959
5818959 / Switch_PHP_versions.md
Created September 22, 2018 12:38
Switch PHP versions in Mac OS
@5818959
5818959 / git-create-revisioninfo-hook.sh
Created October 12, 2018 07:00 — forked from ThomDietrich/git-create-revisioninfo-hook.sh
git hook for revision and branch version file
#!/bin/bash
## Automatically generate a file with git branch and revision info
##
## Example:
## [master]v2.0.0-beta-191(a830382)
## Install:
## cp git-create-revisioninfo-hook.sh .git/hooks/post-commit
## cp git-create-revisioninfo-hook.sh .git/hooks/post-checkout
## cp git-create-revisioninfo-hook.sh .git/hooks/post-merge