git checkout --orphan future-master
git add -A # Add all files and commit them
git commit
git branch -D master # Deletes the master branch
git branch -m master # Rename the current branch to master
git push -f origin master # Force push master branch to github
git gc --aggressive --prune=all # remove the old files
| <?php | |
| // Import arbitrary config from a variable. | |
| // Assumes $data has the data you want to import for this config. | |
| $config = \Drupal::service('config.factory')->getEditable('filter.format.basic_html'); | |
| $config->setData($data)->save(); | |
| // Or, re-import the default config for a module or profile, etc. | |
| \Drupal::service('config.installer')->installDefaultConfig('module', 'my_custom_module'); |
When you try to remove the docker image with the following command
docker rmi 6795374be8c1
Sometimes you might be facing below error:
Error response from daemon: conflict: unable to delete 6795374be8c1 (cannot be forced) - image has dependent child images
Below is the Docker command line used to find the dependent child images
| <?php | |
| /** | |
| * Implements hook_theme_suggestions_HOOK_alter(). | |
| */ | |
| function THEMENAME_theme_suggestions_block_alter(array &$suggestions, array $variables) { | |
| $block_id = $variables['elements']['#id']; | |
| // See if block ID contains the word mobile. | |
| $is_mobile_block = strpos($block_id, 'mobile'); | |
| $block = \Drupal\block\Entity\Block::load($block_id); |
| <?php | |
| /** | |
| * These aliases (while working) are NO LONGER MAINTAINED. | |
| * | |
| * Development has moved to a full github repo here: | |
| * https://github.com/ModulesUnraveled/Drush-Shell-Aliases | |
| * | |
| * I'm doing this to make it more easy to include them in your Drupal 8 projects. |
| {# | |
| /** | |
| * @file | |
| * Default theme implementation to display a paragraph in Bootstrap Paragraphs. | |
| * | |
| * Available variables: | |
| * - paragraph: Full paragraph entity. | |
| * - id: The paragraph ID. | |
| * - bundle: The type of the paragraph, for example, "image" or "text". | |
| * - authorid: The user ID of the paragraph author. |
| {# | |
| /** | |
| * @file | |
| * SVG Icon template | |
| * | |
| * Variables: | |
| * - icon: Name of the icon; SVG should exist as build/img/icons/{icon}.swg | |
| * - text: Fallback text for screen readers, and when icon is not present. | |
| * - text_class: Provides a class using boolean text_visible, to add a class | |
| * which determines whether fallback text should appear visually or not. |
Composer is a package manager similar to NPM for JavaScript, but for dealing with PHP packages. We use it to manage Drupal core, contributed modules (and other 3rd party libraries needed) and patches. The following section is a quick reference for common tasks. Ensure you have installed/updated Composer before proceeding.
*Note about Git: While this will be obvious to most, it bears mentioning that after you're finished installing, updating or patching with Composer, you'll need to add the changes/additions to version control.
Note: When a specific version isn't specified, composer prefers stable over RC over beta over alpha over DEV releases.
| <?php | |
| /** | |
| * This is project's console commands configuration for Robo task runner. | |
| * | |
| * @see http://robo.li/ | |
| */ | |
| class RoboFile extends \Robo\Tasks { | |
| use terminusLoadTasks; |
| #! /bin/zsh | |
| ## An automated Drupal backup script using Drush and ZSH globbing. | |
| ## Ideally place this script in usr/local/bin | |
| ## Set this to run via a cronjob. | |
| ## Easy crontab setup: http://crontab-generator.org | |
| ## Inspiration from: by https://www.drupal.org/node/470114 |