Needs the patch: https://www.drupal.org/node/1848686
Split "Administer vocabularies and terms" permission: Access the taxonomy overview page and Add terms in vocabulary name
File structure:
mymodule
|- src
<?php | |
$dir = __DIR__ . '/data/folder-to-delete'; | |
$it = new RecursiveDirectoryIterator($dir, RecursiveDirectoryIterator::SKIP_DOTS); | |
$files = new RecursiveIteratorIterator($it, | |
RecursiveIteratorIterator::CHILD_FIRST); | |
foreach($files as $file) { | |
if ($file->isDir()){ | |
rmdir($file->getRealPath()); |
<?php | |
/** | |
* Image to PSD converter | |
* | |
* Converts an base64 encoded image (PNG) to PSD via ImageMagick. | |
* | |
* The receiving data must be an array with | |
* - id = Unique dataset id. | |
* - name = Image name. | |
* - images = Array with the image data. |
#!/usr/bin/python | |
import fileinput | |
import json | |
print json.dumps( json.loads(''.join([line.strip() for line in fileinput.input()])), sort_keys=True, indent=2) |
#### | |
## Blackfire config - `lando rebuild` required | |
#### | |
BLACKFIRE_CLIENT_ID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxx | |
BLACKFIRE_CLIENT_TOKEN=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx | |
BLACKFIRE_SERVER_ID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxx | |
BLACKFIRE_SERVER_TOKEN=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx |
# Enable maintanance mode | |
drush state-set system.maintenance_mode 1 | |
# Backup file field data | |
drush sql-query "CREATE TABLE media__field_file_bak AS SELECT * FROM media__field_file;" | |
drush sql-query "CREATE TABLE media_revision__field_file_bak AS SELECT * FROM media_revision__field_file;" | |
# Truncate file field tables (need to change storage settings) | |
drush sql-query "TRUNCATE media__field_file;" | |
drush sql-query "TRUNCATE media_revision__field_file;" |
Global Coder Install | |
$ composer global require drupal/coder | |
PHPCS zur Pfadvariable hinzufügen in ~/.profile, ~/.bash_profile oder ~/.bashrc | |
export PATH="$HOME/AppData/Roaming/Composer/vendor/bin:$PATH" | |
Standards registrieren | |
$ phpcs --config-set installed_paths C:\Users\[USER]\AppData/Roaming/Composer/vendor/drupal/coder/coder_sniffer | |
Prüfung durchführen mit |
Needs the patch: https://www.drupal.org/node/1848686
Split "Administer vocabularies and terms" permission: Access the taxonomy overview page and Add terms in vocabulary name
File structure:
mymodule
|- src
// Detection if an element is added to DOM | |
function onElementInserted(containerSelector, elementSelector, callback) { | |
var onMutationsObserved = function(mutations) { | |
mutations.forEach(function(mutation) { | |
if (mutation.addedNodes.length) { | |
var elements = $(mutation.addedNodes).find(elementSelector); | |
for (var i = 0, len = elements.length; i < len; i++) { | |
callback(elements[i]); | |
} | |
} |
#!/bin/bash | |
# 1. git fsck --lost-found | |
# 2. run this script via bash restore.php | |
cd PATH_TO/.git/lost-found/other | |
FILES=* | |
COUNTER=0 | |
for f in $FILES; do | |
echo "Processing $f file..." | |
git show $f > "PATH_TO/recover/$COUNTER.txt" |