Skip to content

Instantly share code, notes, and snippets.

View AllieRays's full-sized avatar

Allie Ray Jones AllieRays

View GitHub Profile
@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.
@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 / 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 / .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 / 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 / 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 / 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 / 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 / php interstitial drupal module
Created June 8, 2015 17:32
a custom module for drupal that creates a popup interstitial. This module uses Drupal's entity metawrapper api, and dynamic db queries. See full module here https://github.com/devupable/popup-interstitial-drupal
<?php
/**
* @file
* Sample Bean Content to fill out icttemplate
*/
//http://www.pixelite.co.nz/article/how-use-entity-metadata-wrappers-drupal-7/
//https://www.drupal.org/dynamic-queries
//http://ovistaoa.dev/devel/php
include_once 'idi_interstitial.features.inc';
include_once 'idi_interstitial.features.field_base.inc';
@AllieRays
AllieRays / js pop up interstitial
Created June 8, 2015 17:30
js pop up interstitial for drupal custom module. See rest of module here, https://github.com/devupable/popup-interstitial-drupal
(function ($) {
Drupal.behaviors.idi_interstitial = {
attach: function (context, settings) {
$('.block--bean-interstitial a.external, .block--bean-interstitial-iframe a.external ').click(function () {
$.colorbox.close();
return true;
});
$('.block--bean-interstitial .internal, .block--bean-interstitial-iframe .internal').click(function () {
$.colorbox.close();
return false;