This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// No need to log this script operation in New Relic's stats. | |
// PROTIP: you might also want to use this snippet if you have PHP code handling | |
// very fast things like redirects or the like. | |
if (extension_loaded('newrelic')) { | |
newrelic_ignore_transaction(); | |
} | |
$app_info = get_app_info( PANTHEON_ENVIRONMENT ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$folder = $_ENV['HOME'] . '/files'; | |
/** | |
* Recursive function to retrieve directory + subdirectory sizes. | |
* | |
* @param $dir | |
* Absolute filepath to directory we need to check. | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Usage: | |
# Run this script to fetch/sync Pantheon log files every | |
# two seconds. You can change the refresh rate by adjusting | |
# the "n" argument in the "watch" command. | |
# Running this script and then "tail -F" on your log file | |
# will return (nearly) real-time log output. | |
# Example: tail -F ~/logs/php-error.log |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# npm_post.sh | |
# This script finds any .info files in the node_modules directory and renames them so they don't | |
# conflict with drush. package.json runs this on completion of npm install. | |
# These files, if any are not actually needed to run grunt and compile LIbSass | |
# See this issue for more info: https://www.drupal.org/node/2329453 | |
find -L ./node_modules -type f -name "*.info" -print0 | while IFS= read -r -d '' FNAME; do | |
mv -- "$FNAME" "${FNAME%.info}.inf0" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rsync --partial --progress --rsh=ssh user@host:remote_file local_file |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
InvalidArgumentException: The URI 'base://From left to right: Monique Coombs - Maine Coast Fishermen’s Association, Taylor Witkin - Eating with the Ecosystem, and Alan Lovewell - Real Good Fish talk about values' is malformed. in Drupal\Core\Url::fromUri() (line 298 of core/lib/Drupal/Core/Url.php). | |
_pathologic_replace(Array) | |
preg_replace_callback('~ (href|src|action|longdesc)="([^"]+)~i', '_pathologic_replace', ' | |
Want to Catch Up on the goings on at the LocalCatch.org network's #LocalSeafoodSummit2016? | |
Check out our Community Organizer Shira Tiffany's <a href=" Monique Coombs - Maine Coast Fishermen’s Association, Taylor Witkin - Eating with the Ecosystem, and Alan Lovewell - Real Good Fish talk about values">blog post</a>. | |
') | |
_pathologic_filter(' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#0 /var/www/annenberg/drupal/includes/form.inc(1459): form_execute_handlers('validate', Array, Array) | |
#1 /var/www/annenberg/drupal/includes/form.inc(1189): _form_validate(Array, Array, 'ctools_entity_f...') | |
#2 /var/www/annenberg/drupal/includes/form.inc(889): drupal_validate_form('ctools_entity_f...', Array, Array) | |
#3 /var/www/annenberg/drupal/includes/form.inc(385): drupal_process_form('ctools_entity_f...', Array, Array) | |
#4 /var/www/annenberg/drupal/sites/all/modules/contrib/ctools/includes/wizard.inc(125): drupal_build_form('ctools_entity_f...', Array) | |
#5 /var/www/annenberg/drupal/sites/all/modules/contrib/ctools/includes/content.inc(621): ctools_wizard_multistep_form(Array, 'step1', Array) | |
#6 /var/www/annenberg/drupal/sites/all/modules/contrib/panels/plugins/display_renderers/panels_renderer_editor.class.php(749): ctools_content_form('edit', Array, Array, Array, 'node:title_fiel...', Array, Array, 'step1') | |
#7 [internal function]: panels_renderer_editor->ajax_edit_pane('18', 'step1') | |
#8 /var/www/annenberg/d |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Return a comma-separated list of module machine names. | |
* This excludes core modules and disabled modules. | |
*/ | |
$drupal_version = (int) VERSION; | |
$list_modules_function = ''; | |
if ($drupal_version >= 7 && $drupal_version < 8) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$query = \Drupal::entityQuery('node'); | |
// Optionally, add the following line to delete only a certain type of node. | |
//->condition('type', 'event'); | |
$nids = $query->execute(); | |
$storage_handler = \Drupal::entityManager()->getStorage('node'); | |
$entities = $storage_handler->loadMultiple($nids); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Speaker: Ryan Weaver (@weaverryan) | |
Drupalcon LA | Tuesday | Symfony toolkit | |
Install Symfony | |
1. download code (symfony new my_project) | |
2. start webserver (php app/console server:run) | |
Make a page | |
1. create a route (YML file) |