Skip to content

Instantly share code, notes, and snippets.

diff --git a/Response.php b/Response.php
index 9544a671..54dd215c 100644
--- a/Response.php
+++ b/Response.php
@@ -370,15 +370,29 @@ class Response
*/
public function send()
{
+ if (extension_loaded('newrelic')) {
+ newrelic_add_custom_tracer("Response::send/sendHeaders");
@grahambates
grahambates / gist:7598358
Last active December 29, 2015 02:09
Deploy with Git
## Create user for git:
As root:
useradd git-user
passwd git-user
chmod +xr /home/git-user/
## Create empty git repo:
@grahambates
grahambates / gist:7335051
Created November 6, 2013 12:06
Delete any unused Drupal module directories. Assumes '/sites/all/modules/contrib' etc. directory structure, hence depth of 5. Change this if required. Removes any directories that contain no enabled modules, taking into account sub-modules.
drush sqlq "SELECT DISTINCT SUBSTRING_INDEX(filename , '/', 5) dir
FROM system
WHERE status = 0
AND type = 'module'
AND filename NOT LIKE 'modules/%'
HAVING dir NOT IN (
SELECT SUBSTRING_INDEX(filename , '/', 5)
FROM system
WHERE status = 1
);" | xargs rm -rf