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 // Replace this: ?> | |
<?php print $content; ?> | |
<?php // With this: ?> | |
<?php if (isset($block->title_link)): ?> | |
<?php print l($content, $block->title_link, array('attributes' => array('title' => $block->title_link_title), 'html' => TRUE)); ?> | |
<?php else: ?> | |
<?php print $content; ?> |
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 | |
// Mini module to remove Block Title Link options from Menu Block blocks | |
function MODULE_form_alter(&$form, &$form_state, $form_id) { | |
if ($form_id == 'block_admin_configure') { | |
$module = $form['module']['#value']; | |
if ($module == 'menu_block') { | |
// remove fieldset | |
unset($form['settings']['block_titlelink']); |
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
/**********************************************/ | |
/* | |
/* IR_Black Skin by Ben Truyman - 2011 | |
/* | |
/* Based on Todd Werth's IR_Black: | |
/* http://blog.toddwerth.com/entries/2 | |
/* | |
/* Inspired by Darcy Clarke's blog post: | |
/* http://darcyclarke.me/design/skin-your-chrome-inspector/ | |
/* |
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
# Creates a baseline from your current branch (should usually be 8.x). | |
alias bbranch='./xhprof-kit/benchmark-branch.sh `git rev-parse --abbrev-ref HEAD`' | |
# Using the baseline xhprof identifier from the bbranch command above will benchmark 8.x against the baseline and your patched branch. | |
# e.g. | |
# bbranches [XHPROF-IDENTIFIER] [twig-branch-name-here-1234456] | |
function bbranches() { | |
originalbranch="$(git rev-parse --abbrev-ref HEAD)" | |
base=$1 | |
shift |
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
# Clean up Drupal 8 installation and do a pull. | |
function cleand8() { | |
chmod u+w sites/default | |
git reset --hard | |
git checkout 8.x | |
git pull | |
sudo rm -rf sites/default/files/php | |
drush cc all | |
} |
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
# These ones are for OS X. | |
alias cav='curl `pbpaste` | git apply -v --check' | |
alias capv='curl `pbpaste` | patch -p1 --dry-run' | |
# These are untested but should work on many flavours of Linux. If they don't, | |
# please leave a comment! | |
alias cav='curl `xsel --clipboard --output` | git apply -v --check' | |
alias capv='curl `xsel --clipboard --output` | patch -p1 --dry-run' | |
# Patch shortcuts (some duplication of the above, but covers more use cases). |
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 | |
/** | |
* Implements hook_theme_suggestions_HOOK_alter() for node.html.twig. | |
*/ | |
function MYTHEME_theme_suggestions_node_alter(array &$suggestions, array $variables) { | |
// Add template suggestions based on the current view mode. | |
$node = $variables['elements']['#node']; | |
$suggestions[] = 'node__' . $variables['elements']['#view_mode']; | |
$suggestions[] = 'node__' . $node->bundle() . '__' . $variables['elements']['#view_mode']; | |
} |
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
on open location messageUri | |
(* | |
Extract message ID from the message:// URI. Where [MESSAGEID] is the message ID, | |
the Dispatch OS X URL Helper sets up URLs for Mail.app in the following format: | |
message://%3c[MESSAGEID]%3e | |
*) | |
set messageId to text 14 thru -4 of messageUri | |
do shell script "open x-postbox-message://" & messageId | |
end open location |
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
services: | |
cache.backend.memory: | |
class: Drupal\Core\Cache\MemoryBackendFactory |
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 | |
namespace Drupal\twitter_pull\Plugin\Block; | |
use Drupal\Core\Block\BlockBase; | |
/** | |
* Provides a block for executing PHP code. | |
* | |
* @Block( | |
* id = "twitter_pull_tweets_block", |
OlderNewer