This file contains hidden or 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 | |
/** | |
* Implements hook_drush_command(). | |
*/ | |
function seed_derivatives_drush_command() { | |
$items = array(); | |
$items['seed_derivatives'] = array( | |
'description' => "Create image derivatives", |
This file contains hidden or 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
#!/usr/bin/env php | |
<?php | |
/** | |
* @file domain_fix cloud hook for the Acquia Cloud | |
* @author Adam Malone <[email protected]> | |
* | |
* This file should be placed in /hooks/common/post-db-copy | |
* and will allow domains in domain_access module to be updated | |
* following database copy. This ensures no manual updates to |
This file contains hidden or 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 | |
/** | |
* @file | |
* Utilities for use in protecting an environment via basic auth or IP whitelist. | |
*/ | |
function ac_protect_this_site() { | |
global $conf; |
This file contains hidden or 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 | |
SALT=`< /dev/urandom tr -dc _A-Z-a-z-0-9 | head -c${1:-10};echo;` | |
PW=`< /dev/urandom tr -dc _A-Z-a-z-0-9 | head -c${1:-18};echo;` | |
HASH=`openssl passwd -1 -salt $SALT $PW` | |
echo "Automatically generated password of $PW salted against $SALT gets hashed as $HASH" |
This file contains hidden or 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
#!/usr/bin/env perl | |
use strict; | |
use warnings; | |
use HTTP::Request; | |
use LWP::UserAgent; | |
use JSON; | |
use utf8; | |
binmode(STDOUT, ":utf8"); |
This file contains hidden or 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 | |
$options['shell-aliases']['offline'] = 'variable-set -y --always-set maintenance_mode 1'; | |
$options['shell-aliases']['online'] = 'variable-delete -y --exact maintenance_mode'; | |
$options['shell-aliases']['sync-dbs'] = '!drush sql-sync --structure-tables-key=common --no-cache {{#prod}} {{@target}}'; | |
$options['shell-aliases']['sync-files'] = '!drush rsync {{#prod}}:%files {{@target}}:%files'; | |
$options['structure-tables']['common'] = array('cache', 'cache_filter', 'cache_menu', 'cache_page', 'history', 'sessions', 'watchdog'); | |
$options['shell-aliases']['sync-fsdb'] = '!drush sql-sync {{#prod}} {{@target}} && drush rsync {{#prod}}:%files {{@target}}:%files'; |
This file contains hidden or 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 | |
$adam = array( | |
'remote-host' => 'adammalone.net', | |
'root' => '/var/www/html/adammalone/docroot', | |
'uri' => 'adammalone.net', | |
'strict' => 0, | |
'path-aliases' => array( | |
'%dump-dir' => '/home/adammalone/.drush/dumps', | |
'%files' => 'sites/default/files', |
This file contains hidden or 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 | |
$url = 'URL GOES HERE'; | |
$key = 'KEY GOES HERE'; | |
// View https://developers.google.com/speed/docs/insights/v1/getting_started#before_starting to get a key | |
$data = json_decode(file_get_contents("https://www.googleapis.com/pagespeedonline/v1/runPagespeed?url=$url&key=$key")); | |
$dat = $data->formattedResults->ruleResults; | |
foreach($dat as $d) { | |
$name = $d->localizedRuleName; |
This file contains hidden or 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
use strict; | |
use warnings; | |
use HTTP::Request; | |
use LWP::UserAgent; | |
use Regexp::Common qw /net/; | |
use JSON; | |
my $email = 'FILLME'; | |
my $password = 'FILLME'; | |
my $badger = 'https://api.badger.com'; |
This file contains hidden or 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 | |
# Memcache | |
print "Memcache API\n"; | |
$conf['cache_backends'][] = './sites/all/modules/memcache/memcache.inc'; | |
$conf['cache_default_class'] = 'MemCacheDrupal'; | |
bench_it(); | |
#Memcache Storage | |
print "Memcache Storage\n"; |