Skip to content

Instantly share code, notes, and snippets.


Eric Peterson iamEAP

View GitHub Profile
iamEAP / install-promise.html
Created Nov 16, 2015
WDC Promise Samples
View install-promise.html
<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 / .travis.yml
Last active Jul 25, 2016
Template for integrating Travis-CI and Pantheon Multidev
View .travis.yml
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.
- 5.3
iamEAP / gist:8462456
Created Jan 16, 2014
Example method to remove simple $form['#prefix'] and $form['#suffix'] elements from rendered markup in a Drupal 6 page preprocess function using SimpleXMLElement.
View gist:8462456
* 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 /
Last active Nov 3, 2015
Keep Pantheon test environment up-to-date and squeeky clean
# Authenticate with Terminus
drush pauth $PEMAIL --password=$PPASS
View gist:637813ca759e385b02d4
name: Eric Peterson
- php
- js
- api
- modules
- performance
- tableau
iamEAP / 0_reuse_code.js
Last active Aug 29, 2015
Here are some things you can do with Gists in GistBox.
View 0_reuse_code.js
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
iamEAP / .usephp
Last active Aug 29, 2015
Shell function for switching between PHP versions (CLI/FPM)
View .usephp
# 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 > ~/.usephp
# - echo "[[ -s \"\$HOME/.usephp\" ]] && source \"\$HOME/.usephp\" # Load usephp as a function" >> ~/.bash_profile