Skip to content

Instantly share code, notes, and snippets.

View robdecker's full-sized avatar

Rob Decker robdecker

View GitHub Profile
@robdecker
robdecker / views-view-grid.tpl.php.php
Last active November 2, 2019 04:08
[Views: grid template of DIVs] #d7
<?php
/**
* @file
* Default simple view template to display a rows in a grid.
*
* - $rows contains a nested array of rows. Each row contains an array of
* columns.
*
* @ingroup views_templates
@robdecker
robdecker / any.php
Last active November 2, 2019 04:05
[Format 2 dates into a range string] #php
<?php
/**
* Format start/end dates of a range for printing to the screen.
* ex: "April 11 - 18, 2011" or "December 29, 2011 - January 3, 2012"
*
* @param DateTime $start : start of the range
* @param DateTime $end : end of the range
* @return string : the formatted string
*/
function mnnshow_format_date_range($start, $end){
body {
min-width: 550px; /* 2x LC width + RC width */
}
#container {
padding-left: 200px; /* LC width */
padding-right: 150px; /* RC width */
}
#container .column {
position: relative;
float: left;
@robdecker
robdecker / any.css
Last active November 2, 2019 04:09
[Equal height columns] #css
#container {
overflow: hidden;
}
#container .column {
padding-bottom: 20010px; /* X + padding-bottom */
margin-bottom: -20000px; /* X */
}
@robdecker
robdecker / settings.php
Last active November 11, 2020 01:16
[No theme css/js in .info since core's css/js aggregation sometimes breaks themes] #d7
<?php
// Theme serves either minified css/js or uncompressed css/js.
$conf['theme_minified_css'] = TRUE;
$conf['theme_minified_js'] = TRUE;
if (defined('PANTHEON_ENVIRONMENT')) {
switch (PANTHEON_ENVIRONMENT) {
case 'dev':
@robdecker
robdecker / README.md
Last active May 1, 2021 22:01
[Sass folder structure best practices] #sass
@robdecker
robdecker / settings.php
Last active November 11, 2020 01:16
[Load local settings in settings.php] #d7
/**
* Use local settings, if available.
*/
$local_settings = dirname(__FILE__) . '/settings.local.php';
if (file_exists($local_settings)) {
include $local_settings;
}
@robdecker
robdecker / _mixins.scss
Last active November 11, 2020 01:17
[Font Awesome :after mixin] #sass
// Custom Font Awesome :after
@mixin font-awesome-after($fa-icon, $margin: 5px) {
&:after {
font-family: FontAwesome;
font-weight: normal;
font-style: normal;
display: inline-block;
content: $fa-icon;
text-decoration: inherit;
position: relative;

brewStack update for fresh install

Install steps:

  • Install Homebrew:

      $ ruby <(curl -fsSkL raw.github.com/mxcl/homebrew/go)  
      $ brew install git  
      $ brew update  
    

$ brew install drush

@robdecker
robdecker / any.php
Last active November 2, 2019 01:46
[Theme an image via an image style] #d7
print theme('image_style', array( 'path' => $images[$i]['uri'], 'style_name' => 'photo-slideshow', 'attributes' => array('class' => 'img'.$i)));