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
<?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
<script>
Qualtrics.SurveyEngine.addOnload(function() {
/*Place your JavaScript here to run when the page loads*/
submitRFI();
});
function submitRFI() {
// Variable for specific Salesforce instances
const env = "osu.secure";
// const env = "sandboxjme-osu.cs9";
@emerham
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
emerham / innobackupex-restore.sh
Last active Aug 29, 2015 — forked from dalecaru/innobackupex-restore.sh
Scripts to create and restore full and incremental backups (for all databases on server) using innobackupex from Percona.
View innobackupex-restore.sh
#!/bin/sh
#
# 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.
#
INNOBACKUPEX=innobackupex-1.5.1
INNOBACKUPEXFULL=/usr/bin/$INNOBACKUPEX
TMPFILE="/tmp/innobackupex-restore.$$.tmp"
You can’t perform that action at this time.