Skip to content

Instantly share code, notes, and snippets.

View betweenbrain's full-sized avatar
🎯
Focusing

Matt Thomas betweenbrain

🎯
Focusing
View GitHub Profile
@betweenbrain
betweenbrain / index.php
Created July 12, 2012 17:56
Alternative module chrome for Construct Framework - no surrounding markup required
<jdoc:include type="modules" name="nav" style="nav" id="nav" module-class="clear clearfix" />
@betweenbrain
betweenbrain / gist:3107246
Created July 13, 2012 20:30
Ye olde first and last menu item classes override for Joomla 2.5 / 3.0
<?php
/**
* @package Joomla.Site
* @subpackage mod_menu
*
* @copyright Copyright (C) 2005 - 2012 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
@betweenbrain
betweenbrain / gist:3171294
Created July 24, 2012 17:17
Construct Framework module chrome example
function modChrome_div($module, $params, $attribs)
{
$id = isset($attribs['id']) ? $attribs['id'] : null;
$headerLevel = isset($attribs['level']) ? (int)$attribs['level'] : 3;
$headerClass = isset($attribs['header-class']) ? $attribs['header-class'] : 'je-header';
$moduleClass = isset($attribs['module-class']) ? $attribs['module-class'] : null;
if (!empty($module->content)) : ?>
<div <?php if ($id) echo 'id="' . $id . '"'; ?> class="moduletable<?php echo $params->get('moduleclass_sfx') ?><?php if ($moduleClass) echo ' ' . $moduleClass ?>">
<?php if ($module->showtitle) : ?>
@betweenbrain
betweenbrain / gist:3177533
Created July 25, 2012 17:55
Add Last Updated option to DOCman Lister Module
Index: modules/mod_docman_lister/mod_docman_lister.php
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- modules/mod_docman_lister/mod_docman_lister.php (revision 8471095389776d5ccbf4e639ec0a9be1dc8bc55d)
+++ modules/mod_docman_lister/mod_docman_lister.php (revision )
@@ -102,6 +102,11 @@
$order = "name";
$dir = "DESC";
@betweenbrain
betweenbrain / gist:3562838
Created September 1, 2012 02:22
Regex to Replace Microsoft Word => PDF bullet point with HTML list item
Search for:
 ([a-zA-Z0-9,\n\t’.\(\)\-\—/ ]*)
Replace with:
<li>$1</li>
@betweenbrain
betweenbrain / gist:3562854
Created September 1, 2012 02:24
non-breaking hyphen
&#8209;
@betweenbrain
betweenbrain / gist:4725131
Last active December 12, 2015 05:58
Format K2 Date Type Extra Field
echo JHTML::_('date', $item->extraFields->EXTRAFIELDALIASHERE->value , JText::_('%m/%d/%y'))
@betweenbrain
betweenbrain / gist:4731411
Created February 7, 2013 14:54
git archive only changes made between two commits
git archive --output=<file> HEAD $(git diff --name-only commit1SHA commit2SHA)
<?php if ($this->countModules('logo')) { ?>
<div id="logo">
<jdoc:include type="modules" name="logo" style="raw" />
</div>
<?php } else { ?>
<H2 id="site-title">My Totally Awesome Site!</h2>
<h3 id="site-description">Indeed, it is an awesome site.</h3>
<?php } ?>
@betweenbrain
betweenbrain / gist:4963701
Created February 15, 2013 21:30
Linux: Continually monitor current directory for file changes
watch -d -n 1 ls -l