Skip to content

Instantly share code, notes, and snippets.

Avatar

Eric Peterson iamEAP

View GitHub Profile
@iamEAP
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>
View gist:637813ca759e385b02d4
---
name: Eric Peterson
email: epeterson@tableau.com
favSkills:
- php
- js
- api
- modules
- performance
- tableau
@iamEAP
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
iamEAP / .usephp
Last active Aug 29, 2015
Shell function for switching between PHP versions (CLI/FPM)
View .usephp
#!/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
@iamEAP
iamEAP / nightly_workflow.sh
Last active Nov 3, 2015
Keep Pantheon test environment up-to-date and squeeky clean
View nightly_workflow.sh
#!/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
@iamEAP
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.
#
php:
- 5.3
@iamEAP
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]');