Skip to content

Instantly share code, notes, and snippets.

View labboy0276's full-sized avatar

John Ouellet labboy0276

View GitHub Profile
@labboy0276
labboy0276 / php.ini
Created February 8, 2017 18:19
OpCache Settings for PHP 7.x
[opcache]
; Determines if Zend OPCache is enabled
opcache.enable=1
; Determines if Zend OPCache is enabled for the CLI version of PHP
opcache.enable_cli=0
; The OPcache shared memory storage size.
opcache.memory_consumption=128
@labboy0276
labboy0276 / default.vcl
Last active March 26, 2017 16:09
LEMP Varnish 4 config for Drupal 7 & 8 / Pressflow 6 & 7
/*
* Varnish 4 example config for Drupal 7 & 8 / Pressflow 6 & 7
*/
# Original source: https://github.com/NITEMAN/varnish-bites/varnish4/drupal-base.vcl
# Copyright (c) 2015 Pedro González Serrano and individual contributors.
# MIT License
# Intended to be used both in simple production environments and with
# learning/teaching purposes.
@labboy0276
labboy0276 / k2m_force_title.info
Last active January 26, 2016 22:06
Force FPP Admin Title, Change as needed
name = Kettering Force Title
description = This module is for forcing the admin title on all FPPs that are reusable.
package = Kettering
core = 7.x
version = 7.x-0.1
dependencies[] = fieldable_panels_panes
@labboy0276
labboy0276 / settings.local.php
Last active January 24, 2016 15:05
Drupal 8 Local Settings for using with Pantheon based D8 site
<?php
/**
* @file
* Local development override configuration feature.
*
* To activate this feature, copy and rename it such that its path plus
* filename is 'sites/default/settings.local.php'. Then, go to the bottom of
* 'sites/default/settings.php' and uncomment the commented lines that mention
* 'settings.local.php'.
@labboy0276
labboy0276 / gist:e831c5ac32dea7352bb5
Created January 20, 2016 21:01
Convert Contextual Filter to another FORM API Type
/**
* Implements hook_form_alter().
*/
function k2m_profiles_form_alter(&$form, &$form_state, $form_id) {
if ($form_id == 'views_content_views_panes_content_type_edit_form') {
if (isset($form['arguments']['field_k2m_profile_classification_target_id'])) {
// Grab the taxonomy to make the options win.
$vid = taxonomy_vocabulary_machine_name_load('classification')->vid;
$terms = taxonomy_get_tree($vid);
john@kalamuna:~/kalabox/apps/d8tester$ kbox terminus cli version
PHP Strict Standards: Non-static method Terminus::get_logger() should not be called statically, assuming $this from incompatible context in phar:///usr/local/bin/terminus/php/class-terminus-command.php on line 32
Strict Standards: Non-static method Terminus::get_logger() should not be called statically, assuming $this from incompatible context in phar:///usr/local/bin/terminus/php/class-terminus-command.php on line 32
PHP Strict Standards: Non-static method Terminus::get_outputter() should not be called statically, assuming $this from incompatible context in phar:///usr/local/bin/terminus/php/class-terminus-command.php on line 33
Strict Standards: Non-static method Terminus::get_outputter() should not be called statically, assuming $this from incompatible context in phar:///usr/local/bin/terminus/php/class-terminus-command.php on line 33
Terminus version: 0.8.0
Terminus script: terminus
@labboy0276
labboy0276 / file.php
Created September 11, 2015 15:43
Change contextual filter to a Select list on Pane
/**
* Implements hook_form_FORMID_alter().
*/
function ccm_publications_form_views_content_views_panes_content_type_edit_form_alter(&$form, &$form_state) {
// Change this out to be a select list.
if (isset($form['arguments']['field_ccm_publication_type_tid'])) {
$v = taxonomy_vocabulary_machine_name_load('ccm_publication_type');
$terms = taxonomy_get_tree($v->vid);
foreach ($terms as $term) {
$vocab[$term->tid] = $term->name;
debug: EVENTS => Error dispatching event listeners [post-install]. VError: Error running ad hoc container with kalabox/terminus:v0.9.0.: Error: "Processing failed."
at Object.<anonymous> (/home/john/kb2/node_modules/kalabox-engine-docker/docker.js:691:13)
From previous event:
at Object.use (/home/john/kb2/node_modules/kalabox-engine-docker/docker.js:690:11)
From previous event:
at /home/john/kb2/lib/engine.js:566:29
From previous event:
at Object.exports.use (/home/john/kb2/lib/engine.js:565:4)
at /home/john/kalabox/apps/pan-tester/plugins/kalabox-plugin-pantheon/lib/client.js:76:29
@labboy0276
labboy0276 / gist:77711056ba2054d133f6
Last active August 29, 2015 14:23
Panels Everywhere + Default Search
Install the page_manager_search && search combine, set it up as you please but use search_combine as default.
Create a variant in the site_template for the search, set it to be above the default one. Use a selection for path URL sites/all/* on the string.
To render the default search_view as a block use:
/**
* Implements hook_block_info().
*/
@labboy0276
labboy0276 / Bootstrap Modal Print
Last active February 25, 2023 16:20
Bootstrap Modal Print
How to print a Bootstrap Modal (this was for Drupal 7 site as a FYI):
Add this to the modal
<button type="button" class="btn btn-default print" onClick="window.print();return false">Print</button>
Create a JS file and do this:
( function($) {
$(document).ready(function(){
// Add Print Classes for Modal
$('.modal').on('shown.bs.modal',function() {