View gist:d853b3f1dc6dbe29d865d2f8f02d360c
<?php
if (isset($_SERVER['PANTHEON_ENVIRONMENT']) && php_sapi_name() != 'cli') {
if ($_SERVER['PANTHEON_ENVIRONMENT'] == 'dev' || $_SERVER['PANTHEON_ENVIRONMENT'] === 'kalabox') {
$conf['theme_debug'] = 1;
$conf['cache'] = FALSE; //page cache
$conf['block_cache'] = FALSE; //block cache
$conf['preprocess_css'] = FALSE; //optimize css
$conf['preprocess_js'] = FALSE; //optimize javascript
View gist:ed985e4f367c8d82309cbb298038cddd
SELECT TABLE_NAME, table_rows, data_length, index_length,
round(((data_length + index_length) / 1024 / 1024),2) "Size in MB"
FROM information_schema.TABLES
WHERE table_schema = "something"
ORDER BY round(((data_length + index_length) / 1024 / 1024),2) DESC
LIMIT 0,15;
View gist:6707330b41fdfb6002f48b9fe040ed80
# Allow all loopback (lo0) traffic and reject traffic
# to localhost that does not originate from lo0.
-A INPUT -i lo -j ACCEPT
-A INPUT ! -i lo -s 127.0.0.0/8 -j REJECT
# Allow ping and traceroute.
-A INPUT -p icmp --icmp-type 3 -j ACCEPT
-A INPUT -p icmp --icmp-type 8 -j ACCEPT
-A INPUT -p icmp --icmp-type 11 -j ACCEPT
View gist:3c5e0d413fe9ae8e86dc886fb6ab2a21
KeepAlive Off
<ifmodule mpm_prefork_module="">
StartServers 2
MinSpareServers 6
MaxSpareServers 12
MaxClients 30
MaxRequestsPerChild 3000
</ifmodule>
View gist:c5b7200eb9ef4ea7dac290cd4d7d90be
<?php
/**
* Implements hook_action_info().
*/
function mymodule_action_info() {
return array(
'mymodule_update_products' => array(
'type' => 'entity',
'label' => t('Update products by 2%'),
View gist:82c74fc99306551bd800e26cffe14c67
<?php
/**
* Implements hook_page_attachments().
*/
function mymodule_name_page_attachments(array &$page) {
$description = [
'#tag' => 'meta',
'#attributes' => [
'name' => 'description',
'content' => 'This is my website.',
View gist:67bc3e951531fc54d47e4133a2cc0637
<?php
$uid = 2;
$user = user_load($uid);
$role = user_role_load_by_name("editor");
$user->roles = $user->roles + array($role->rid => $role->name);
user_save($user);
$users = array(2, 3, 4);
$role = user_role_load_by_name("editor");
View gist:0dfab95e4e6c872dfd9bdfdde4ff5daa
DELETE FROM `flood`;
DELETE FROM flood WHERE event = 'failed_login_attempt_user' AND identifier LIKE '123-%'; #123 is the UID of the blocked user
View gist:c403ad8d8489f0b0c75151ac40553d38
<?php
$trace = debug_backtrace();
header('content-type: text/plain');
print_r($trace);
exit;
///
/**
* Implementation of hook_watchdog().
View gist:24d58cc586ffcb1cc19fd8ee29b7bbff
<?php
$base_url = 'http://localhost/test_endpoint';
$data = array(
'username' => 'admin',
'password' => 'pass',
);
$data = http_build_query($data, '', '&');
$headers = array();
$options = array(
'headers' => array(