Skip to content

Instantly share code, notes, and snippets.

@allierays
allierays / Bash script for Drupal site installation
Created June 8, 2015 17:35
Bash script for Drupal site installation. Using bash, and Drupal install profile
#!/bin/bash
function announce {
if [ ! -z "$1" ]; then
echo ""
echo "~~~~~~~~~~ $1"
echo ""
fi
}
#------------------------- variables & inputs -------------------------#
@allierays
allierays / Drupal Install profile
Last active August 29, 2015 14:22
Drupal Install profile
<?php
/**
* @file
* The install file for the SITE_FOLDER_NAME distribution.
*
* used https://www.drupal.org/project/agov and https://www.drupal.org/project/standard for reference
* https://www.drupal.org/node/1022020 -- How to Write a Drupal 7 Installation Profile
*
*/
@allierays
allierays / Node.js RESTful api controller example
Created June 8, 2015 17:40
Node.js Book controller. Node.js RESTful api controller example. See rest of example here https://github.com/devupable/restfulapi-example
var bookController = function (Book) {
var post = function (req, res) {
var book = new Book(req.body);
if (!req.body.title) {
res.status(400);
res.send('Title is required');
}
else {
@allierays
allierays / bar.php
Last active November 14, 2021 17:58
Programmatically create multiple taxonomy terms in Drupal 8
<?php
// Programmatically create taxonomy terms for taxonomy module on install.
// This is the bar.install file included in a module.
use Drupal\taxonomy\Entity\Term;
use Symfony\Component\Yaml\Yaml;
function foo_taxonomy_install() {
$vocabularies = [
@allierays
allierays / .clean.sh
Last active July 11, 2016 15:55
Bash Script for cleaning directories, useful for branch switching with Drupal 8's configuration system.
#!/usr/bin/env bash
SITENAME=sitename
DBPATH=/var/www/$SITENAME/dev.sql
echo ""
echo -n "You are about to destory all of" $SITENAME"'s files not saved in git, drop the database and load a backup. Are you sure you want to do this?[y/n]: "
read YESNO
if [ "$YESNO" == "y" ]
then
@allierays
allierays / config.yml
Created May 10, 2017 04:45
Config overrides for DrupalVM for a local git repo.
vagrant_hostname: sitename.dev
vagrant_machine_name: sitename
vagrant_ip: 192.168.88.90 [make a new ip address ]
vagrant_synced_folders:
- local_path: ~/Sites/sitename
destination: /var/www/sitename
type: nfs
drupal_build_makefile: false
@allierays
allierays / Core-lightning-blt-upgrade.md
Last active December 21, 2018 14:55
Upgrading Drupal Core 8.6, BLT, 9.2.2 and Lightning 3.2.3

Upgrading Drupal Core 8.6, BLT, 9.2.2 and Lightning 3.2.3

() Review outdated dependencies

composer outdate

or review /admin/reports/updates

Before you Start

  • Your project composer.json should not manage drush or drupal. BLT and lightining will do that in their respective composer.lock files
  • If you have scheduled_updates installed uninstall it. Export your configurationn and then do the lightning update.
@allierays
allierays / README.md
Created November 13, 2018 18:55
Sanitized Updated Readme file for Projects with BLT

My Project

2018 Multisite D8 Repo for [project_name].

Getting Started

This project is based on BLT, an open-source project template and tool that enables building, testing, and deploying Drupal installations following Acquia Professional Services best practices. While this is one of many methodologies, it is our recommended methodology.

  1. Review the Required / Recommended Skills for working with a BLT project.
  2. Ensure that your computer meets the minimum installation requirements (and then install the required applications). See the System Requirements.
<?php
/**
* SAML 2.0 remote IdP metadata for SimpleSAMLphp.
*
* Remember to remove the IdPs you don't use from this file.
*
* See: https://simplesamlphp.org/docs/stable/simplesamlphp-reference-idp-remote
*/
$metadata['https://adfsint.videotron.com/adfs/services/trust'] = [
## Acquia BLT with DDev for Windows with all Prerequisites as of May 8 2020
This exercises purpose is to ensure your Windows 10 machine has all of the following prerequisites required to run BLT and DDEV to create a local development environment.
Required prerequisites
* Windows 10 build 1909
* Admin permissions
At the end of this exercise the following system requirements should be setup \
() Windows 10 build 1909 with Admin permissions and Hyper V enabled\
() A windows package manager \