Skip to content

Instantly share code, notes, and snippets.

View psynaptic's full-sized avatar

Richard Burford psynaptic

View GitHub Profile
/**
* Implements hook_preprocess().
*/
function clean_liquid_preprocess(&$variables) {
clean_preprocess($variables);
}
$ git browse
Please set $BROWSER to a web launcher to use this command.
$ export BROWSER=echo
$ git browse
https://github.com/user/repo/tree/branch
# Import bash resource file.
if [ "$BASH" ]; then
if [ -f ~/.bashrc ]; then
source ~/.bashrc
fi
fi
<?php
/**
* Override or insert variables into the page templates.
*
* @param $variables
* An array of variables to pass to the theme template.
*/
function clean_liquid_preprocess_page(&$variables) {
if (isset($variables['attributes_array']['class'])) {
(function($) {
Drupal.behaviors.channelMenuSelect = {
attach: function (context, settings) {
$('#channel-menu-select').change(function() {
var $path_fragment = $(this).val();
if (IsNumeric($path_fragment) && $path_fragment != 0) {
window.location = Drupal.settings.mobile.channelMenuPath + $path_fragment;
}
});
<div %attributes>
%title_prefix
%title
%title_suffix
<div %content_attributes>
%content
</div>
</div>
<?php
$pattern = '#<p[^/>]*>(\s|&nbsp;)*</p\s*>\s*\n?#';
$subject = <<<DOC
<p> </p> <p> </p>
<p>&nbsp;</p><p>&nbsp;</p><p>&nbsp;</p><p>&nbsp;</p>
<p>&nbsp;</p> <p>&nbsp;</p>
<p class="bold"></p>
<p>&nbsp;</p>
/**
* Implements hook_filter_info().
*/
function ex_mobile_filter_info() {
return array(
'ex_mobile_strip_p' => array(
'title' => t('Strip empty paragraphs'),
'description' => t('Removes paragraph tags from text which have only whitespace inside of them.'),
'process callback' => 'ex_mobile_filter_ex_mobile_strip_p_process',
'cache' => TRUE,
preexec () {
echo -ne "\ek$2\e\\"
}
/* Right column */
.holygrail {
background: #CDEAFF;
}
/* Left column */
.holygrail .colleft {
background: #CFC;
}