Skip to content

Instantly share code, notes, and snippets.

@Greg-Boggs
Greg-Boggs / gist:f3e3429c07fc59b8a44d3a6a48728ae6
Created November 7, 2017 19:20
Drupal User Group Outline
Tell the folks who you are and welcome them to portland DUG
Give them this list in a breif overview of what they can expect. Let them know about the after group hangout at Pints.
Show them Groups.Drupal and encourage them to sign up for email updates by joining the group.
Get folks into IRC/Slack.
Call for organizers for next year.
Call for Speaker for next month.
Thank the sponsor.
Promote brewpal.
Announcements (PNW).
Ice breaker question.
@Greg-Boggs
Greg-Boggs / ListingPluginDisplayBlock.php
Last active September 1, 2017 20:35
Use exposed filters in a Drupal 8 block view without using "ajax".
<?php
namespace Drupal\bene_listing_page\Plugin\views;
use Drupal\views\Plugin\views\display\Block;
use Drupal\views\Plugin\views\display\DisplayPluginBase;
/**
* The plugin that handles a block.
*
* @ingroup views_display_plugins
*
brew install php71 --without-apache --with-fpm
brew install php71-opcache
brew install php71-mcrypt
brew install php71-xdebug
$(brew --prefix gettext)/bin/envsubst < ~/ts_environment/config/php-ts.ini > $(brew --prefix)/etc/php/php71/conf.d/php-ts.ini
brew services start php70

PHP Configuration file including xdebug is here: https://github.com/thinkshout/ts_environment/blob/master/config/php-ts.ini

@Greg-Boggs
Greg-Boggs / Readme.md
Last active June 21, 2017 23:19
Steps to install Drupal Commerce snd Mailchimp on Pantheon and Locally. Pantheon steps not needed for other hosting.

Install Composer and Git.

Install Terminus.

composer require pantheon-systems/terminus

Create a new site on Pantheon.

Choose Drupal 8.

@Greg-Boggs
Greg-Boggs / email.php
Created February 3, 2017 18:39
Test email
<?php
$to = 'nobody@example.com';
$subject = 'the subject';
$message = 'hello';
$headers = 'From: webmaster@example.com' . "\r\n" .
'Reply-To: webmaster@example.com' . "\r\n" .
'X-Mailer: PHP';
mail($to, $subject, $message, $headers);
?>
<!-- Facebook share -->
<div id="fb-root"></div>
<script>(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
js = d.createElement(s); js.id = id;
js.src = "//connect.facebook.net/en_US/sdk.js#xfbml=1&version=v2.8";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>
https://easyengine.io/tutorials/php/fpm-sysctl-tweaking/
@Greg-Boggs
Greg-Boggs / rebuild.sh
Created August 1, 2016 23:44
Rebuild Facing History
./scripts/build.sh ~/Sites/fh -y
cd ~/Sites/fh
drush sql-drop -y
tbg facing-history
drush updb -y
drush pm-disable logs_http salesforce_pull -y
drush en stage_file_proxy dblog -y
drush cc all
@Greg-Boggs
Greg-Boggs / id_rsa.pub
Created June 13, 2016 19:55
My Public Key
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDF4SrdNP+7l+aj9IVUXi64L5bdcEZ5xtIQ0GBb6qY5GBG5pC0sCT+ZNkVo7Qczmpx6duYcgY8LydbTBjkir9fEfICt9AfVOs51bBrnj2glpdOKVvahwsAEIhSPBZ3jams4kWitqaRrV8mL1fjOgogy4DgPdYykDp1jpDmFqIbBAV/KN0jWi1iBf3B/CAVE55+AKlOO51jZUw17f4T/EHFlJ2sFy1QQVBNXHvZm6r7ui3SUJPQXwdUgJmvkAeARbfWXEiwuRnf2Dff/iZHurtNIqa7d70jwaK2A71JiXJTexeKgKoUGoTSymSmMI5PAyieTc6pS+d3fBvd9PmZFA1C3 gregboggs@Gregs-MacBook-Pro.local
@Greg-Boggs
Greg-Boggs / my_module.php
Created April 29, 2016 00:17
Render a Drupal 8 link in a view alter.
<?php
/**
* Implements hook_entity_view_alter().
*/
function my_module_entity_view_alter(array &$build, EntityInterface $entity, EntityViewDisplayInterface $display) {
$build['my_custom_link'] = Link::fromTextAndUrl('Edit Information', $url)->toRenderable();
}