composer global require drupal/coder
composer global show -P # should be equivalent to ~/.composer/vendor/drupal/coder
# Register Coder Standards: Drupal and DrupalPractice
composer global require drupal/coder:^8.2.12
composer global require dealerdirect/phpcodesniffer-composer-installer
# Review standards
Get Linux make, version and other info (same as cat /etc/os-release
but with broader scope):
$ cat /etc/*release*
PRETTY_NAME="Debian GNU/Linux 9 (stretch)"
NAME="Debian GNU/Linux"
VERSION_ID="9"
VERSION="9 (stretch)"
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
This file contains 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
Compiled from gist thread: https://gist.github.com/evanscottgray/8571828 | |
##CONTAINERS | |
stop all containers: | |
docker stop $(docker ps -a -q) | |
--prefereable | |
docker kill $(docker ps -q) | |
--brute force | |
remove all containers |
You need to create a local branch that tracks a remote branch. The following command will create a local branch named daves_branch
, tracking the remote branch origin/daves_branch
. When you push your changes the remote branch will be updated.
For most versions of git:
git checkout --track origin/daves_branch
--track is shorthand for git checkout -b [branch] [remotename]/[branch]
where [remotename]
is origin in this case and [branch]
is twice the same, daves_branch
in this case.
For git 1.5.6.5 you needed this:
git checkout --track -b daves_branch origin/daves_branch
This file contains 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
When you create a tar archive of a directory tree the hidden files are normally not included. Here’s how to include the hidden files. | |
Say you have a web directory called “/var/www/html/mysite/” that contains the following tree: | |
.htaccess | |
index.php | |
logo.jpg | |
style.css | |
admin_dir/.htaccess | |
admin_dir/includes.php |
This file contains 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
If you need a quick way to reset your public_html data to 755 for directories and 644 for files, then you can use something like this: | |
cd /path/to/sites/site/docroot | |
find . -type d -exec chmod 0755 {} \; | |
find . -type f -exec chmod 0644 {} \; | |
additionally, if you know php runs as the user and not as "apache", then you can set php files to 600, for an extra level of security, eg: | |
find . -type f -name '*.php' -exec chmod 600 {} \; |
This file contains 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
drush eval "var_dump(Drupal\Component\Utility\Crypt::randomBytesBase64(55))" |
This file contains 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
function array_merge_recursive_ex(array & $array1, array & $array2) | |
{ | |
$merged = $array1; | |
foreach ($array2 as $key => & $value) | |
{ | |
if (is_array($value) && isset($merged[$key]) && is_array($merged[$key])) | |
{ | |
$merged[$key] = array_merge_recursive_ex($merged[$key], $value); | |
} else if (is_numeric($key)) |
NewerOlder