Skip to content

Instantly share code, notes, and snippets.

Matthew Brabham emerham

  • Oregon State University
  • Oregon
View GitHub Profile
View drupal-paragraphs-field-collection.php
// Rendering Paragraphs Menu Items
$paragraph_items = field_get_items('paragraphs_item', $variables['paragraphs_item'], 'field_p_menu');
$field_collection = field_collection_field_get_entity($paragraph_items[0], 'field_p_menu');
print render(field_view_field('field_collection_item', $field_collection, 'field_p_menu_link', [
'type' => 'link_title_plain',
'label' => 'hidden'
print render(field_view_field('field_collection_item', $field_collection, 'field_p_menu_link', [
'type' => 'link_plain',
View kaltura-media-ids.js
* Injects the ID of the Kaltura video.
document.addEventListener("DOMContentLoaded", function(){
let tbodys = document.getElementsByTagName("TBODY");
let totalTables = tbodys.length;
for (let t = 0; t < totalTables; t++){
let linkData = tbodys[t].getElementsByClassName("views-field views-field-field-url");
let kalturaIdCell = tbodys[t].getElementsByClassName("kaltura-id");
for ( let l = 0; l < linkData.length; l++) {
View qualtrics-salseforce.html
Qualtrics.SurveyEngine.addOnload(function() {
/*Place your JavaScript here to run when the page loads*/
function submitRFI() {
// Variable for specific Salesforce instances
const env = "";
// const env = "sandboxjme-osu.cs9";
emerham / id-differences-for-dev-and-prod.json
Last active Oct 10, 2017 — forked from jaredkosanovic/id-differences-for-dev-and-prod.json
The old IDs are what are currently in prod, and the new IDs are what's currently in dev. If the building name changed in addition to the ID, then it's not included in this file since we don't have a good way to know that the buildings were the same.
View id-differences-for-dev-and-prod.json
"buildings": {
"OSU Open Campus - Corvallis": {
"new": "ce450c4443a09e5635165df7b4a8bd74",
"old": "ce450c4443a09e5635165df7b4a8bd74"
"North Porch Cafe": {
"new": "dde04c526a9605a44084a4a9f7e08f96",
"old": "46aca402f531a0d513ef8d9413533866"
emerham /
Last active Aug 29, 2015 — forked from dalecaru/
Scripts to create and restore full and incremental backups (for all databases on server) using innobackupex from Percona.
# Script to prepare and restore full and incremental backups created with innobackupex-runner.
# This script is provided as-is; no liability can be accepted for use.
You can’t perform that action at this time.