Skip to content

Instantly share code, notes, and snippets.

View justrjlewis's full-sized avatar

RJ Lewis justrjlewis

View GitHub Profile
@justrjlewis
justrjlewis / Concrete5 Reverse Sort Stack Contents
Last active December 30, 2015 12:08
Sorting Concrete5 stack contents in reverse order.
<?php
$a = new GlobalArea('Your Area Name'); //since I normally do this within a block, I append something unique to these such as a blockID, or custom user input instead of( 'Your Area Name') it's ($variable.' Your Area Name')
if ($page->isEditMode()) {
$a->display($c); //show regular while we're editing — we're changing what is shown on the page
} else {
$stacks = Stack::getByName('Your Area Name');
$blocks = $stacks->getBlocks();
krsort($blocks); //reverse sort the blocks in the stack
foreach($blocks as $block) {
$block->display(); //display the newly sorted blocks
@justrjlewis
justrjlewis / Sparse Checkout
Last active December 26, 2015 00:09
shell commands to sparse checkout a file.
git init
git remote add -f <name> <url>
git config core.sparsecheckout true
echo in/repo/path/to/sub_directory/*> .git/info/sparse-checkout
git pull origin master
@justrjlewis
justrjlewis / index.html
Created October 11, 2012 00:28
2009 Module Rework in jQuery
<div class="tip_box">
<ul class="tabs">
<li>
<a href="#tab1"><h6>tutoring</h6></a>
</li>
<li>
<a href="#tab2"><h6>discussions</h6></a>
</li>
<li>
<a href="#tab3"><h6>workshops</h6></a>
@justrjlewis
justrjlewis / index.html
Created October 6, 2012 00:13
This is an old module that I coded in vanilla JS for Westwood College Tutoring Center back when I was a student.
<div class="tips">
<ul>
<li>
<a id="l0" onclick="settab(0);changeit('pic',0);return false;"><h6 class="regular">tutoring</h6></a>
</li>
<li>
<a id="l1" onclick="settab(1);changeit('pic',1);return false;"><h6 class="regular">discussions</h6></a>
</li>
<li>
<a id="l2" onclick="settab(2);changeit('pic',2);return false;"><h6 class="regular">workshops</h6></a>