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
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
<?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
# 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 | |
/** | |
* @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
<?php | |
final class Redirect extends SqlBase { | |
/** | |
* Return list of additional redirects that doesn't exist in source db. | |
* | |
* Some redirects are not in db, but we need to add them. | |
* | |
* @return array[] |
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
{% if pp_media.asset.meta.type === 'image' %} | |
{{ attach_library('easy_responsive_images/resizer') }} | |
{% set srcset = [ | |
asset.sizes['400w'].url ~ ' 600w', | |
asset.sizes['900w'].url ~ ' 900w', | |
asset.sizes['3000w'].url ~ ' 3000w', | |
] %} | |
<img src="{{ src }}" data-srcset="{{ srcset|join(',')|raw }}" alt="{{ pp_media.asset.meta.alt }}" loading="lazy" /> | |
{% endif %} |
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
# https://www.drupal.org/project/workflow/issues/3016286 | |
# https://www.drupal.org/project/drupal/issues/3157105#comment-13830538 | |
process: | |
... | |
moderation_state: | |
plugin: default_value | |
default_value: published | |
process: | |
... |
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
// https://github.com/drush-ops/drush/issues/3396#issuecomment-1009268719 | |
// Bulk generate using action: https://gist.github.com/seth-shaw-unlv/bd64930fa1f75be3aba05ade34433092 | |
// accountSwitcher->switchTo(new UserSession(['uid' => 1]); |
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
# https://stackoverflow.com/questions/1987926/how-do-i-recursively-grep-all-directories-and-subdirectories | |
grep --include="*.ext" -nRHI "text" ~/projects/ |