Skip to content

Instantly share code, notes, and snippets.

View jessehs's full-sized avatar

Jesse Hofmann-Smith jessehs

  • Phase2 Technology
  • El Prado, New Mexico, USA
View GitHub Profile
@jhedstrom
jhedstrom / gist:33e26b2400989fa6416e
Created January 28, 2015 19:43
Drupal with composer
$> drush use @existing-d7-site
$> drush dl composer_generate
$> mkdir /tmp/new-site
$> drush composer-generate > /tmp/new-site/composer.json
$> cd /tmp/new-site
$> composer install
$> composer require drupal/views
anonymous
anonymous / SQL for Blobs
Created May 30, 2014 20:41
Serialized Data Blob Whittling technique. This one grabs the created date out of the ubercart order id.
SELECT
FROM_UNIXTIME(
SUBSTRING_INDEX(
SUBSTRING_INDEX(
SUBSTRING_INDEX(uo.data, 'created', -1),
';}', 1),
';i:', -1)
)
AS `Created Date`
FROM bitch_prod.uc_orders uo
@joetower
joetower / Drupal Nonsense
Last active May 23, 2018 12:46
Preprocess and template snippets related to front-end theming stuff.
Preprocess
// Slideshow wrapper to allow absolute placement of slideshow content//
function theme-name_preprocess_views_view_fields(&$vars, $hook){
if ($vars['view']->name == 'slideshow') {
$vars['fields']['title']->wrapper_prefix = '<div class="slideshow-content-wrapper">' . $vars['fields']['title']->wrapper_prefix;
$vars['fields']['field_slide_button_link']->wrapper_suffix .= '</div>';
}
}