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
<?php | |
/** | |
* @file | |
* recreateMigrationMapTables.drush.php | |
* | |
* Usage: | |
* @code | |
* drush scr recreateMigrationMapTables.drush.php [MIGRATION_ID] | |
* @endcode | |
*/ |
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
# Check php compatibility | |
# source: https://www.specbee.com/blogs/drupal9-and-its-compatibility-with-php-8-learn-whats-new | |
vendor/bin/phpcs -p . --standard=PHPCompatibility \ | |
--runtime-set 7.4 \ | |
--extensions=php,module,install,inc \ | |
--report-full==./php7.4-compatibility.txt |
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
<?php | |
use Drupal\migrate_plus\Event\MigrateEvents as MigratePlusEvents; | |
use Drupal\migrate_plus\Event\MigratePrepareRowEvent; | |
use Drupal\migrate\Plugin\MigrateIdMapInterface; | |
function dry_run_migration($migration_id) { | |
// Get the migration source. | |
$migrationManager = \Drupal::service('plugin.manager.config_entity_migration'); | |
$migration = $migrationManager->createInstance($migration_id); |
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
git add -N . | |
git diff --staged > media_entity_soundcloud-v3-prevent-media-clear-old-configuration-3208259-2.patch |
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
ffmpeg -i 'https://example.com/playlist.m3u8' -bsf:a aac_adtstoasc -vcodec copy -c copy -crf 50 ~/video_file.mp4 |
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
lando info --filter service=database | |
# or | |
lando info --format=json | jq '.[] | select(.service=="database") | .external_connection.port ' | |
# to suppress nodejs warnings run lando with | |
# see https://github.com/lando/lando/issues/2928 | |
node --no-warnings /path/to/lando.js info --format=json | jq '.[] | select(.service=="database") | .external_connection.port' |
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
# intstall database | |
# drush si --db-url=mysql://root:pass@localhost:port/dbname | |
drush si --db-url=mysql://drupal:drupal@mariadb/drupal | |
# export db | |
drush sql-dump > db.sql | |
# import db | |
drush sql-cli < db.sql |
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
{ | |
"type": "project", | |
"license": "GPL-2.0-or-later", | |
"authors": [ | |
{ | |
"name": "", | |
"role": "" | |
} | |
], | |
"repositories": [ |
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 | |
# Note: the path is relative to the DRUPAL_ROOT | |
# drush dcer --folder | |
drush dcer taxonomy_term 11972 --folder=modules/custom/my_module/modules/my_module_demo_content/content | |
drush dcer question 13 --folder=modules/custom/my_module/modules/my_module_demo_content/content |
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
# Credit http://stackoverflow.com/a/2514279 | |
for branch in `git branch -r | grep -v HEAD`;do echo -e `git show --format="%ci %cr" $branch | head -n 1` \\t$branch; done | sort -r |