This file contains 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 | |
#### Configuration for MEOS Drupal 8 Backups with RoboFile | |
## Site URI | |
$siteuri='example.com'; | |
## Folder where you want backups to be stored remotely. No trailing slashes! | |
$remotebackupbasepath='/home/user/backups/squidixvps'; | |
## Remote backup user and server in the form of user@server |
This file contains 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 hashsalt --description 'Generate Drupal 8 hash salt in the current directory in the file, hash_salt.txt. Best to generate in composer project root and ignore in .gitignore. To use this file in settings.php use a line like: $settings[\'hash_salt\'] = file_get_contents(\'../hash_salt.txt\');' | |
drush eval "print_r(Drupal\Component\Utility\Crypt::randomBytesBase64(55))" > hash_salt.txt | |
echo 'hash_salt.txt has been generated. Best to generate in composer project root and ignore in .gitignore. To use this file in settings.php use a line like: $settings[\'hash_salt\'] = file_get_contents(\'../hash_salt.txt\');' | |
end |
This file contains 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 code is from the "DrupalCon Baltimore 2017: Demystifying Rendered Content in Drupal 8 Twig Files" presentation by Amy Vaillancourt-Sals slide 30 "Create a custom file name suggestion". | |
* Video: https://www.youtube.com/watch?v=qoeRpRkGwmk | |
* Slides: https://drive.google.com/file/d/0B8g8dQw8nc9eV3U4SjZKNWNEWGM/view?usp=sharing | |
* Drupalcon Baltimore Session: https://events.drupal.org/baltimore2017/sessions/demystifying-rendered-content-drupal-8-twig-files | |
* This code adds Twig templates for block bundles. Replace "themename" below with your theme's machine name. | |
* Implements hook_theme_suggestions_HOOK_alter() for templates. | |
* @param array $suggestions | |
* @param array $variables | |
*/ |
This file contains 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
api: '2' | |
core: 7.x | |
# Specify common subdir of "contrib" | |
defaults: | |
projects: | |
subdir: "contrib" | |
libraries: | |
bad-behavior: | |
download: | |
type: "file" |
This file contains 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 force HTTPS using the .htaccess file | |
To force all web traffic to use HTTPS insert the following lines of code in the .htaccess file in your website’s root folder. | |
Important:If you have existing code in your .htaccess, add this above where there are already rules with a similar starting | |
prefix. | |
# Redirect to SSL version of a site without needing to set the domain name, | |
RewriteCond %{HTTPS} off | |
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R,L] |
This file contains 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 | |
# Bash script for installing Fish Shell on systems without root access | |
# Fish Shell will be installed in $HOME/local/bin | |
# It's assumed that wget and a C/C++ compiler are installed | |
set -e # exit on error | |
FISH_VER=2.2.0 | |
mkdir -p $HOME/local $HOME/fish_shell_tmp # create our directories | |
cd $HOME/fish_shell_tmp |
This file contains 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 | |
/** Text from slide 49 of "Tailor your backend to meet the clients needs" | |
* http://www.slideshare.net/stevenvdhout/durable-drupal-backend | |
* move the moderation state to the actions region | |
**/ | |
$form['revision_information']['#collapsed'] = TRUE; | |
if (isset($form['revision_information']['workbench_moderation_state_new'])) { | |
$form['actions']['workbench_moderation_state_new'] = $form['revision_information']['workbench_moderation_state_new']; | |
unset($form['revision_information']['workbench_moderation_state_new']); | |
} |
This file contains 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 | |
/** Text from slide 47 of "Tailor your backend to meet the clients needs" | |
* http://www.slideshare.net/stevenvdhout/durable-drupal-backend | |
* Improve the URL selection form | |
**/ | |
if (isset($form['#entity_type']) | |
&& $form['#entity_type'] == 'node' | |
&& isset($form['path']) | |
&& isset($form['path']['alias'])) { | |
unset($form['path']['#type']); // remove the fieldset |
This file contains 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 | |
/** Text from slide 45 of "Tailor your backend to meet the clients needs" | |
* http://www.slideshare.net/stevenvdhout/durable-drupal-backend | |
* remove items from vertical tabs, and add them to another fieldset | |
**/ | |
if (isset($form['#groups']['group_settings'])) { | |
$weight = 0; | |
foreach ($form as $key => $value) { | |
if(is_array($value) && isset($value['#group'])) { | |
unset($form[$key]['#group']); |