This file contains hidden or 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
# Statements in this file will be executed (sourced) by the shell in SSH | |
# sessions, in deploy hooks, in cron jobs, and in the application's runtime | |
# environment. | |
# This loads nvm for general usage. | |
export NVM_DIR="$HOME/.nvm" | |
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" |
This file contains hidden or 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
# Run a cron command only on a given branch | |
if [ "$PLATFORM_BRANCH" = master ]; then | |
bin/console whatever | |
fi | |
# And the short version | |
cmd: '[ "$PLATFORM_BRANCH" = "master" ] && bin/console whatever' | |
# Test that an environment works before merging | |
CODE=$(curl -s -w '%{http_code}' $(platform url -e dev --pipe | head -n 1) -o /dev/null) |
This file contains hidden or 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
SELECT | |
table_name, | |
data_length/1048576,index_length/1048576, | |
(data_length+index_length)/1048576 as data_used, | |
data_free/1048576 as data_free, | |
(data_length+index_length+data_free)/1048576 as disk_used | |
FROM information_schema.tables where table_schema = 'main' | |
ORDER BY (data_length+index_length+data_free) ASC; | |
SELECT |
This file contains hidden or 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
git branch -r --merged | grep -v master | sed 's/origin\///' | xargs -n 1 git push --delete origin |
This file contains hidden or 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 a global value. | |
* | |
* A useful shorthand for accessing the Globals object. | |
* | |
* @param string $key | |
* Key to access | |
* |
This file contains hidden or 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 | |
// Load the Config class. | |
$config = \Drupal\config\Config::load(); | |
// Supports JSON, PHP, and optionally YAML. Want XML? Its extensible. | |
$parser_type = CONFIG_PARSER_JSON; | |
// Get the Config. | |
return $config->getConfig('my_module_name', 'directory_within_module', 'file_within_directory.ext', $parser_type); |
This file contains hidden or 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 | |
/** | |
* Hook structure. | |
*/ | |
function hook_node_view($node, $view_mode, $langcode) { | |
// Do something here. | |
} | |
/** |
This file contains hidden or 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 system SET filename = REPLACE(filename, 'sites/all/modules', 'sites/all/modules/contrib'); | |
UPDATE registry SET filename = REPLACE(filename, 'sites/all/modules', 'sites/all/modules/contrib'); | |
UPDATE registry_file SET filename = REPLACE(filename, 'sites/all/modules', 'sites/all/modules/contrib'); |
This file contains hidden or 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
@mixin views-responsive-column-settings($column-count, $local-grid-width) { | |
.views-column-1 { | |
@include zen-grid-item(1, 1, $zen-float-direction, $column-count, $zen-gutter-width, $local-grid-width); | |
} | |
.views-column-2 { | |
@include zen-grid-item(1, 2, $zen-float-direction, $column-count, $zen-gutter-width, $local-grid-width); | |
} |
This file contains hidden or 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 | |
/** | |
* Implements hook_ctools_plugin_directory(). | |
*/ | |
function ghost_formatters_ctools_plugin_directory($owner, $plugin_type) { | |
if ($owner == 'ghost') { | |
if ($plugin_type == GHOST_PLUGIN_TYPE_FORMATTER) { |
NewerOlder