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 | |
/** | |
* To execute this: php headers.php http.//url_to_check.com header | |
*/ | |
$strURL = isset($argv[1]) ? $argv[1] : NULL; | |
$headerFind = isset($argv[2]) ? $argv[2] : NULL; | |
$resCurl = curl_init(); | |
// Set URL and other appropriate options. |
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 | |
/** | |
* Converts the value column from integer to float. | |
*/ | |
function mymodule_update_70XX() { | |
$spec = array( | |
'type' => 'float', | |
'not null' => FALSE, | |
); // DB Column definition. |
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 | |
/** | |
* Enables entity_translation revisions support. | |
*/ | |
function my_module_update_70XX() { | |
$revisionable_entity_types = array(); | |
$query = db_select('entity_translation', 'et') | |
->fields('et', array('entity_type')) |
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 | |
/** | |
* Removes my_field and uninstalls its module. | |
*/ | |
function my_module_update_70XX(&$sandbox) { | |
// If this is the first pass through this update function then set some variables. | |
if (!isset($sandbox['total'])) { | |
$sandbox['field_name'] = 'my_field'; | |
$sandbox['field'] = field_info_field($sandbox['field_name']); | |
$sandbox['module'] = array($sandbox['field']['module']); |
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 | |
/** | |
* Enables multilingual support for variables defined in a group. | |
* | |
* @param string $group | |
* The group of variables to load | |
*/ | |
function enable_multilingual_variables($group) { | |
// Load all the variables defined by group. |
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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |