Skip to content

Instantly share code, notes, and snippets.

@oranblackwell
oranblackwell / buttonLibrary.md
Last active December 30, 2015 00:49
Cross Browser (maximum legacy support -IE6+ and fallback) buttons with background-gradients, broder-radius and box-sizing
@oranblackwell
oranblackwell / Custom Analytics Tracking (config'd for WP)
Created December 6, 2013 10:14
Last edited 2011 WP functions needed. Pass to _gaq by setting _setCustomerVar.
//header.php version - Place just before </head>
##########################################
<?php
require_once($CFG->dirroot.'/blocks/sb_training_tools/lib/locallib.php');
require_once($CFG->dirroot.'/user/profile/lib.php');
/**
*
* Retrieve the displayed user's details
*/
@oranblackwell
oranblackwell / DirectoryListingVariations
Created December 6, 2013 10:48
Various combinations of storing directories and files in a text file in a combination of structures. PC.
# flat directory/file listings
"dir > top-level-folders.txt"
"dir /s > dir.txt" same as above but recursive
"dir /s /w > dir.txt" to get rid of time and date info, etc
# Directory Tree
# /A adjusts the visual tree - adds + and -, and \ for last parent of each level
tree /A > just-folder-structure.txt
tree /A /F > file-and-folder-structure.txt
@oranblackwell
oranblackwell / array_insert_into_middle.php
Last active December 31, 2015 05:49
Replace value within an array with multiple new values while keeping the numerical order AKA insert/replace into the middle of array.
<?php
/**
* replace value within an array with multiple new values while keeping the numerical order
* AKA insert/replace into the middle of array
*
* @param $parentArray
* @param int $numericalKey the key of the element to be removed
*/
$parentArray = array(0,1,2,3,4,5,6,7,8,9);
@oranblackwell
oranblackwell / LikeXML
Created December 16, 2013 12:05
Replicate default XML stylesheet with collapsable sections.
<style>
.likeXML{margin:20px 0}
.likeXML .text{color:#000;font-size:12px}
.likeXML .start-tag,.likeXML .end-tag{
color:#800080 !important;
text-transform:uppercase;
cursor:pointer;
font-weight:bold;
font-size:12px
}
@oranblackwell
oranblackwell / Git - Check which tag you are currently on
Created April 17, 2014 14:03
Git - Check which tag you are currently on
git describe --tags
@oranblackwell
oranblackwell / 01. Notes.md
Last active March 22, 2018 22:24
Terminal commands

Various Terminal Commands

Creating Aliases

Note on interpolation

Invoked as an interactive login shell, or with `--login'

# Interactive means you can enter commands. The shell is not running because 
#+ a script has been activated. A login shell means that you got the shell after

Row and Column Paddings

div[class*="col-"].no-padding { padding : 0; }
div[class*="col-"].no-padding-left { padding-left : 0; }
div[class*="col-"].no-padding-right { padding-right : 0; }
.top-buffer { margin-top : 20px; }

Pull-Right Breakpoints

@media (min-width : 768px) {

Various Wordpress Snippets

Add image dimensions

add_image_size( 'category-single', 285, 220, true ); // home page grid & category side
add_image_size( 'category-double', 285, 510, true ); // home page grid

Show which template file is currently being used.

Emmet string for Our Clubs Page
<!-- EMMET -->
.show-outline>(.row>(.col-sm-6.col-xs-12>.media>(img.pull-left+.media-body>h2{h2 here})+p.the_content{the content here})+(.col-sm-6.col-xs-12>(.col-xs-12>h3{h3 here})+((.col-sm-4.col-xs-12>.repeater_label{repeater label $})+(.col-sm-8.col-xs-12>.repeater_value{repeater value $}))*3))+.row>.col-xs-12.collapsible>(header>h3{h3 here})+(.col-sm-6.col-xs-12>h4{h4 here}+img.social-icons*4)+(.col-sm-6.col-xs-12>(.col-sm-4.col-xs-12{label $}+.col-sm-8.col-sm-12{value $})*3)|c