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
# Switch to root user. | |
sudo su - | |
# Update apt repositories and install dependencies. | |
apt-get update | |
apt-get install libglib2.0-dev libmysqlclient15-dev zlib1g-dev libpcre3-dev libssl-dev cmake | |
# Download mydumper source and move to appropriate directory. | |
cd /usr/local/share | |
wget https://launchpad.net/mydumper/0.9/0.9.1/+download/mydumper-0.9.1.tar.gz |
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 | |
/** | |
* @file | |
* | |
* Replaces all of the panels content categories with a single "All" tab. | |
* | |
* To enable, simply do the following: | |
* - Search & replace "example" with your module name. | |
* - Run `drush vset example_panels_all_category 1` |
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
/** | |
* Disable the continue buttons in the checkout process once they are clicked | |
* and provide a notification to the user. | |
*/ | |
Drupal.behaviors.aibmCommerceCheckout = { | |
attach: function (context, settings) { | |
... | |
var creditCardSelection = $('#edit-commerce-payment-payment-details-credit-card-type', context); | |
if (creditCardSelection.length) { |
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 | |
// Redis configuration | |
$redis_path = 'profiles/aibm_profile/modules/contrib/redis'; | |
$conf['cache_backends'][] = $redis_path .'/redis.autoload.inc'; | |
$conf['redis_client_interface'] = 'PhpRedis'; | |
$conf['cache_prefix'] = array( | |
'default' => 'pantheon-redis', | |
); | |
$conf['cache_default_class'] = 'Redis_Cache'; |
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 | |
function er_migration_update_7003() { | |
// Changing the names of the porfolio field prefixes from modelp to portfolio | |
$fields = array( | |
'field_modelp_title' => array( | |
'data_col_suffix' => array( | |
'value' => 'LONGTEXT', | |
'format' => 'VARCHAR(255) DEFAULT NULL', | |
), | |
), |
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 | |
/** | |
* Validation handler for blah_node_form | |
*/ | |
function wpf_ui_blah_node_form_validate(&$form, &$form_state) { | |
$errors = form_set_error(); | |
// This ensures that empty select responses are dealt with correctly | |
$error_text = 'An illegal choice has been detected. Please contact the site administrator.'; |
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 | |
/** | |
* Render a Ctools custom content pane. | |
* | |
* Mostly useful for when you need to render custom content panes | |
* outside of panels. | |
* | |
* @param $id | |
* Custom content pane machine name. | |
* @return |
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
function melba_uc_init() { | |
... | |
if ($_GET['q'] == 'cart' && !empty($_POST)) { | |
// This is a continuation of a monstrosity born in | |
// sites/all/themes/melba/tempalates/views-view-table--cart-page.tpl.php | |
$cart_id = uc_cart_get_id(FALSE); | |
if (!empty($_POST['delete'])) { | |
// delete items from cart | |
foreach (array_keys(array_filter($_POST['delete'])) as $nid) { | |
melba_uc_cart_item_remove($nid); |
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 | |
function artroom_cron_send_mail($items){ | |
if(empty($items)) | |
return; | |
$link = url("user/login", array("absolute" => true)); | |
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 | |
// Get the requested URL alias and explode into array | |
$q = trim($_SERVER['REQUEST_URI'], '/'); | |
$arg = explode('/', $q); | |
// Shorten the URL by 1 argument | |
$newArg = array_slice($arg, 0, (count($arg) - 1)); | |
// Get the menu item for the new URL |
NewerOlder