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
# 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;" |
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
function getPending() { | |
var amount = 0; | |
$( 'tr.oPending' ).each( function() { | |
var | |
$t = $(this), | |
amt = $t.children( ':eq(4)' ).html().split( '<br>' )[0]; | |
amt = amt.trim().replace( '$', '' ) | |
if ( 0 == amt.indexOf( '(' ) ) { | |
amt = amt.replace( '(', '' ).replace( ')', '' ) * -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
# This is the *third* configuration to import with configuration type: 'Migration' | |
# This migration demonstrates importing from a monolithic JSON file. | |
# Forked from https://github.com/heddn/json_example_migrate/blob/json/web/modules/custom/custom_migrate/config/install/migrate_plus.migration.omdb_json.yml | |
uuid: b113ad9f-1ed7-43e5-802c-0e0270d2b7fa | |
id: omdb_json_article | |
label: JSON feed of movies (Article) | |
migration_group: json_example | |
source: | |
# We use the JSON source plugin. | |
plugin: url |
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
$image = \Drupal::service('image.factory')->get($file->getFileUri()); | |
$image_style = \Drupal\image\Entity\ImageStyle::load('gallery_large'); | |
// Set source image dimensions. | |
$dimensions = [ | |
'width' => $image->getWidth(), | |
'height' => $image->getHeight(), | |
]; | |
// After calling this, the $dimensions array will contain new dimensions. | |
$image_style->transformDimensions($dimensions, $file->getFileUri()); |
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
## | |
## How to install mcrypt in php7.2 / php7.3 | |
## Linux / MacOS / OSX | |
## | |
## https://lukasmestan.com/install-mcrypt-extension-in-php7-2/ | |
# |
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
.PHONY: up upx log down exec exec0 h t | |
CUID := $(shell id -u) | |
CGID := $(shell id -g) | |
IMAGEPHP := skilldlabs/php:8 | |
all: | exec | |
up: | |
docker run --rm --name core9 \ |
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
ubuntu@claw:/var/www/html/drupal/web/modules/contrib/islandora$ drupal config:override | |
Enter configuration name [at_core.settings]: | |
> system.file | |
Enter the configuration key [allow_insecure_uploads]: | |
> temporary_maximum_age | |
Enter the configuration value: | |
> 1 | |
Configuration name system.file |
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
#/bin/sh | |
CURRENT_USER=`whoami` | |
if [ "$CURRENT_USER" == "vagrant" ]; then | |
cd /vagrant; ./xdebug.sh off | |
else | |
vagrant ssh -c "cd /vagrant; sudo ./xdebug.sh off" | |
fi |