Skip to content

Instantly share code, notes, and snippets.

View iamEAP's full-sized avatar

Eric Peterson iamEAP

View GitHub Profile
@iamEAP
iamEAP / .travis.yml
Last active January 20, 2023 09:23
Template for integrating Travis-CI and Pantheon Multidev
language: php
#
# Important to note, this is the version of PHP used to run this build, not the
# one used to run your Drupal installation. Ensure compatibility with the Drush
# and Terminus versions you're using for this build.
#
php:
- 5.3
@iamEAP
iamEAP / install-promise.html
Created November 16, 2015 05:18
WDC Promise Samples
<script src="es6-promise.min.js"></script>
<script src="jquery.min.js"></script>
<script src="wdc-sdk.js"></script>
<script src="your_wdc.js"></script>
@iamEAP
iamEAP / gist:8462456
Created January 16, 2014 20:07
Example method to remove simple $form['#prefix'] and $form['#suffix'] elements from rendered markup in a Drupal 6 page preprocess function using SimpleXMLElement.
/**
* Page preprocess.
*/
function phptemplate_preprocess_page(&$variables) {
// Return the fully rendered search block, and its SimpleXMLElement equivalent.
$block = theme('block', (object) module_invoke('google_appliance', 'block', 'view', 'google_search'));
$block_xml = new SimpleXMLElement($block);
// Parse out $form['#prefix'] and $form['#suffix']
$prefix = $block_xml->xpath('//form/preceding-sibling::*[1]');
@iamEAP
iamEAP / nightly_workflow.sh
Last active November 3, 2015 10:21
Keep Pantheon test environment up-to-date and squeeky clean
#!/bin/bash
PSITE='your-site-name'
PUUID='aaaaaaaa-1111-bbbb-2222-cccccccccccc'
PEMAIL='your-email@example.com'
PPASS='your-password-here--i-know'
# Authenticate with Terminus
drush pauth $PEMAIL --password=$PPASS
---
name: Eric Peterson
email: epeterson@tableau.com
favSkills:
- php
- js
- api
- modules
- performance
- tableau
@iamEAP
iamEAP / 0_reuse_code.js
Last active August 29, 2015 14:12
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@iamEAP
iamEAP / .usephp
Last active August 29, 2015 14:10
Shell function for switching between PHP versions (CLI/FPM)
#!/bin/bash
#
# Useful for switching between PHP versions (CLI and NGINX PHP-FPM) on OS X. Assumes
# you've installed PHP via brew, maybe like so:
# - brew install php56 && cp /path/to/cellar/php56/5.6.*/*.plist ~/Library/LaunchAgents/
#
# Installation:
# - curl https://gist.githubusercontent.com/iamEAP/c7464c7b42583baba98b/raw/.usephp > ~/.usephp
# - echo "[[ -s \"\$HOME/.usephp\" ]] && source \"\$HOME/.usephp\" # Load usephp as a function" >> ~/.bash_profile