Skip to content

Instantly share code, notes, and snippets.

View ari-gold's full-sized avatar

Ariel Gold ari-gold

View GitHub Profile
609143 18/Dec 18:04 notice php Notice: Undefined property: stdClass::$option in form_select_options() (line 2843 of /srv/bindings/151c4963187c4dc8bb0f94a3a3432401/code/includes/form.inc).
609144 18/Dec 18:04 notice php Notice: Undefined property: stdClass::$option in form_select_options() (line 2843 of /srv/bindings/151c4963187c4dc8bb0f94a3a3432401/code/includes/form.inc).
609145 18/Dec 18:04 notice php Notice: Undefined property: stdClass::$option in form_select_options() (line 2843 of /srv/bindings/151c4963187c4dc8bb0f94a3a3432401/code/includes/form.inc).
609146 18/Dec 18:04 notice php Notice: Undefined property: stdClass::$option in form_select_options() (line 2843 of /srv/bindings/151c4963187c4dc8bb0f94a3a3432401/code/includes/form.inc).
609147 18/Dec 18:04 notice php Notice: Undefined property: stdClass::$option in form_select_options() (line 2843 of /srv/bindings/151c4963187c4dc8bb0f94a3a3432401/code/includes/form.inc).
609148 18/Dec 18:04 notice php Notice: Undefined
@ari-gold
ari-gold / disable-plugins-in-development.php
Last active August 29, 2015 14:25
Disable specified WordPress plugins in your development environment. Useful for plugins that either make network calls you don't want when working (eg, auto-posting to Facebook), or for plugins that rely on services only available in production (eg, Varnish).
<?php
/**
* Disable specified plugins in development environment.
*
* This is a "Must-Use" plugin. Code here is loaded automatically before regular plugins load.
*
* Place this code in a file in WP_CONTENT_DIR/mu-plugins or specify a custom location
* by setting the WPMU_PLUGIN_URL and WPMU_PLUGIN_DIR constants in wp-config.php.
* */
if (defined('PANTHEON_ENVIRONMENT')) {
/**
* Handle Subdomain Redirects.
*/
if ($_SERVER['PANTHEON_ENVIRONMENT'] === 'live') {
switch ($_SERVER['HTTP_HOST']) {
// Remove WWW.
case 'www.patch.com':
@ari-gold
ari-gold / pantheon-site-sql-connection-string.sh
Created March 17, 2015 00:00
Find SQL connection string with Terminus and Drush
terminus auth login test@example.com
terminus sites aliases
drush @pantheon.sitename.env sql-connect
@ari-gold
ari-gold / gist:bd29d793241ff12a740f
Created March 5, 2015 23:22
Site in SFTP mode, put services.yml yields "Permission denied"
$ terminus site connection-mode --site=ari-d8 --env=dev --set=sftp
Success: Successfully changed connection mode to sftp
$ sftp -o Port=2222 dev.b0163e0c-febd-4b14-96fb-e7b245c14bdb@appserver.dev.b0163e0c-febd-4b14-96fb-e7b245c14bdb.drush.in
Connected to appserver.dev.b0163e0c-febd-4b14-96fb-e7b245c14bdb.drush.in.
sftp> cd code/sites/default/
sftp> ls
config default.services.yml default.settings.php files settings.php
sftp> put services.yml
Uploading services.yml to /srv/bindings/60d83776d1664b19b452b331bb653f52/code/sites/default/services.yml
remote open("/srv/bindings/60d83776d1664b19b452b331bb653f52/code/sites/default/services.yml"): Permission denied
@ari-gold
ari-gold / collect_logs.sh
Created February 20, 2015 23:18
Download logs from Pantheon site's Live app containers
SITE_UUID=<SITE_UUID>
for app_server in `dig +short appserver.live.$SITE_UUID.drush.in`;
do
mkdir $app_server
sftp -o Port=2222 live.$SITE_UUID@$app_server << !
cd logs
lcd $app_server
mget *.log
!
done