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
/** | |
* This function is reentrant. | |
*/ | |
function mymodule_install_schema_fix() { | |
$constraints = [ | |
'lo_register_phone' => [ | |
'fk_lo_register_phone_user' => "ALTER TABLE {lo_register_phone} ADD CONSTRAINT {fk_lo_register_phone_user} FOREIGN KEY (uid) REFERENCES {users} (uid) ON DELETE CASCADE", | |
], | |
]; |
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
/*jslint browser: true, plusplus: true, todo: true, white: true */ | |
/*globals Drupal, jQuery */ | |
// Simple placeholder fix for IE8, not a polyfill: | |
// If a field has no label displayed: | |
// - If the label is hidden (sr-only or element-invisible) then just show it. | |
// - If there is no label but a placeholder, build a label using the | |
// placeholder value. | |
(function(jQuery) { | |
"use strict"; |
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
#!/bin/sh | |
# Thank you so much, mab! | |
cd $HOME | |
wget https://nodejs.org/dist/v4.1.1/node-v4.1.1-linux-x64.tar.gz | |
tar xzf node-v4.1.1-linux-x64.tar.gz | |
rm -rf node-v4.1.1-linux-x64.tar.gz | |
mv node-v4.1.1-linux-x64 node | |
export PATH="$PATH:$HOME/node/bin" | |
npm install gulp | |
export PATH="$PATH:$HOME/node_modules/.bin" |
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
require_once DRUPAL_ROOT . '/includes/update.inc'; | |
$modules = db_query("SELECT name, 1 FROM {system} WHERE type = 'module'")->fetchAllKeyed(); | |
foreach (array_keys($modules) as $key) { | |
module_load_install($key); | |
$updates = []; | |
// From module.inc/update.inc. | |
$regexp = '/^' . $key . '_update_(?P<version>\d+)$/'; | |
$functions = get_defined_functions(); | |
foreach (preg_grep('/_\d+$/', $functions['user']) as $function) { | |
$matches = []; |
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
// Prevent double click in some forms. | |
(function(jQuery) { | |
"use strict"; | |
Drupal.behaviors.fixDoubleClick = { | |
attach: function (context) { | |
var k, selectors = [ | |
"#comment-form" | |
// Add here forms with problems. | |
]; | |
for (k in selectors) { |
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
$conf['mail_system'] = ['default-system' => 'NetSmtp_MailSystemProxy']; | |
$conf['netsmtp_proxy'] = ['default' => 'MimeMailSystem']; | |
$conf['netsmtp_catch'] = [ | |
'[email protected]', | |
'[email protected]', | |
// ... | |
]; | |
$conf['netsmtp_debug_trace'] = true; | |
$conf['netsmtp_debug_mime'] = true; | |
$conf['netsmtp'] = [ |
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
$mockList = [ | |
[ | |
'name' => "Sa maman", | |
'firstname' => 'Josianne', | |
'lastname' => 'Balasko', | |
], | |
[ | |
'name' => "Des ours", | |
'firstname' => 'Jean', | |
'lastname' => 'Rochefort', |
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
/** | |
* Implements hook_process(). | |
*/ | |
function MYTHEMEORMODULE_process(&$variables, $hook) { | |
// Seems legit. | |
// @see laborange2_theme_registry_alter(). | |
if (false === strpos($hook, 'advanced_forum')) { | |
// This one is a stupid variable mis-use and typo from advanced_forum. | |
if (!empty($variables['theme_hook_suggestion']) && false !== strpos($variables['theme_hook_suggestion'], 'advanced_forum')) { | |
// Do not override the 'theme_hook_suggestion' other than advanced |
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
diff -urN mimemail.orig//mimemail.info mimemail//mimemail.info | |
--- mimemail.orig//mimemail.info 2015-01-12 12:06:10.000000000 +0100 | |
+++ mimemail//mimemail.info 2015-01-12 12:08:23.000000000 +0100 | |
@@ -1,6 +1,5 @@ | |
name = Mime Mail | |
description = Send MIME-encoded emails with embedded images and attachments. | |
-dependencies[] = mailsystem | |
package = Mail | |
core = 7.x | |
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
/** | |
* abs(Number number) : Number result | |
* Returns the absolute value of given number. | |
* A number. | |
* Given number's absolute value. | |
* | |
* @level 1 | |
* @cores 1 | |
* |