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
#!/usr/bin/env bash | |
#Check Files in list from file exist or doesn't exist in directory. | |
if [ $# -eq 0 ] || [ $# -eq 1 ] | |
then | |
echo "You must pass the path to file with the list and the path to directory to check files. \nsh check-file-exist-from-list.sh path/to/file path/to/directory" | |
exit 1 | |
fi | |
while read -r file; do |
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
ALTER TABLE `_raw_comb` ADD INDEX(`_itemnume`); | |
ALTER TABLE `_raw_combh` ADD INDEX(`_itemnume`); | |
ALTER TABLE `_raw_comb_gal_eng` ADD INDEX(`_itemnume`); | |
ALTER TABLE `_raw_comb_gal_he` ADD INDEX(`_itemnume`); |
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 | |
public function addLanguagesToEntityTranslations($entity_type, $entity) { | |
// Get the basic information about the entity. | |
$entity_info = entity_get_info($entity_type); | |
// Get the existing site languages. | |
$languages = array_keys(language_list()); | |
// Add to the entity translation object. Set the original language to | |
// the entity's default language. |
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
$tasks['IMJ_setup_permissions'] = array( | |
'display_name' => st('Set Blocks'), | |
'display' => FALSE, | |
); | |
------------------------------------------------ | |
/** |
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
$httpProvider.interceptors.push(function ($q, Auth, localStorageService, $injector) { | |
return { | |
'request': function (config) { | |
var concatWith = /\?/.test(config.url) ? '&' : '?'; | |
if (config.url != 'template/pagination/pagination.html') { | |
config.url += concatWith + 'XDEBUG_SESSION_START=14394'; | |
} | |
if (!config.url.match(/login-token/)) { | |
config.headers = { |
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
UPDATE `users` SET `mail` = CONCAT(`mail`, '.test') |
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 | |
class FeatureContext extends DrupalContext implements SnippetAcceptingContext { | |
public function iCheckTheRadioButton($labelText) { | |
$page = $this->getSession()->getPage(); | |
foreach ($page->findAll('css', 'label') as $label) { | |
if ( $labelText === $label->getText() ) { | |
$radioButton = $page->find('css', '#'.$label->getAttribute('for')); | |
$value = $radioButton->getAttribute('value'); | |
$radioButton->selectOption($value, FALSE); | |
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
/** | |
* Overrides \RestfulEntityBaseTaxonomyTerm::checkPropertyAccess(). | |
* | |
* Allow user to set the parent term for the unsaved term, even if the user | |
* doesn't have access to update existing terms, as required by the entity | |
* metadata wrapper's access check. | |
*/ | |
protected function checkPropertyAccess($op, $public_field_name, EntityMetadataWrapper $property, EntityMetadataWrapper $wrapper) { | |
$info = $property->info(); | |
$term = $wrapper->value(); |
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
/** | |
* Overrides \RestfulEntityBaseTaxonomyTerm::checkEntityAccess(). | |
* | |
* Allow access to create "Tags" resource for privileged users, as | |
* we can't use entity_access() since entity_metadata_taxonomy_access() | |
* denies it for a non-admin user. | |
*/ | |
protected function checkEntityAccess($op, $entity_type, $entity) { | |
$account = $this->getAccount(); | |
$resource_name = $this->getResourceName(); |
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_field_formatter_info(). | |
*/ | |
function c4m_message_field_formatter_info() { | |
return array( | |
'summary_with_image' => array( | |
'label' => t('Summary or trimmed with image'), | |
'field types' => array('text_with_summary'), | |
) | |
); |