Skip to content

Instantly share code, notes, and snippets.

View jeremycaldwell's full-sized avatar
💭
Currently available for hire.

Jeremy Caldwell jeremycaldwell

💭
Currently available for hire.
View GitHub Profile
@jeremycaldwell
jeremycaldwell / SassMeister-input-HTML.html
Created June 25, 2015 19:30
Generated by SassMeister.com.
<div class="example">
<div class="example-card">
<img class="example-image" src="http://www.jurassicworld.com/media/dinosaurs/dimorphodon/jurassic-world-dimorphodon-share.jpg" alt="" />
<div class="example-text"> Dimorphodon is one of our park’s pterosaurs, or flying reptiles. It evolved to soar through the Jurassic skies, with large eyes, quick jaws and sharp talons perfect for catching fish—or other prey. </div>
<div>
<a class="example-cta" href="#">Learn More</a>
</div>
</div>
<div class="example-card">
<img class="example-image" src="http://www.jurassicworld.com/media/dinosaurs/velociraptor/jurassic-world-velociraptor-share.jpg" alt="" />
@jeremycaldwell
jeremycaldwell / gist:276ef93fa8628a02d69d
Created June 23, 2015 18:41
VBO: Events people role
$view = new view();
$view->name = 'vbo_event_speaker';
$view->description = '';
$view->tag = 'default';
$view->base_table = 'eck_event';
$view->human_name = 'VBO Event Speaker';
$view->core = 7;
$view->api_version = '3.0';
$view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */
@jeremycaldwell
jeremycaldwell / template.php
Created June 3, 2015 22:37
Iterate through all attached field_collections
<?php
// Iterate through all attached field_collections
foreach ($node->field_section['und'] as $delta => $value) {
$fc_entity_id = $value['value'];
// If a background image exists, set it to be the background.
if (isset($vars['content']['field_section']['' . $delta .'']['entity']['field_collection_item']['' . $fc_entity_id . '']['field_section_background']['0']['#item'])) {
$bg_image = $vars['content']['field_section']['' . $delta .'']['entity']['field_collection_item']['' . $fc_entity_id . '']['field_section_background'][0]['#item']['uri'];
$bg_image_path = file_create_url($bg_image);
<div class="two-thirds column">
<h4 class="content-title">Spokane Area Neighborhoods</h4>
<div class="content-tabs">
<ul class="tabs-nav clearfix">
<li><a href="#tab1">South Hill</a></li>
<li><a href="#tab2">Five Mile</a></li>
<li><a href="#tab3">Cheney</a></li>
</ul><!--/ .tabs-nav-->
<div class="tabs-container">
<div class="tab-content" id="tab1">
@jeremycaldwell
jeremycaldwell / SassMeister-input-HTML.html
Created May 27, 2015 16:20
Generated by SassMeister.com.
<div class="page">
<header>
<h1>Hello I'm The Header</h1>
</header>
<div class="hero">
<div class="one">
<h2>I'm by myself</h2>
</div>
<div class="two">
<div><h3>I'm 1</h3></div>
@jeremycaldwell
jeremycaldwell / burger.scss
Last active January 3, 2018 17:35
Sass burger to "x" close
/**
* Burger parts
*
* (---) top -> &:before
* [---] middle -> &
* (---) bottom -> &:after
*/
/**
@jeremycaldwell
jeremycaldwell / panel.php
Last active January 3, 2018 17:35
Checks for content in the field field_myfield
if (isset($contexts['argument_entity_id:people_1']->data->field_quote)) {
$field = $contexts['argument_entity_id:people_1']->data->field_quote;
if (is_null($field)) {
return FALSE;
}
if (is_array($field)) {
foreach ($field as $key => $val) {
if (is_array($val)) {
$field[$key] = array_filter($val);
}
@jeremycaldwell
jeremycaldwell / new_gist_file_0
Created April 30, 2015 22:40
Get specific variable and its value
dpm($contexts['argument_entity_id:people_1']->data->field_quote['und'][0]['value']);
@jeremycaldwell
jeremycaldwell / new_gist_file_0
Created April 30, 2015 22:39
PHP - Get available variables and their values
dpm($contexts);
@jeremycaldwell
jeremycaldwell / template.php
Created April 15, 2015 19:55
Add custom class to Views list based on count.
// For theming purposes we want to add a "clear" class every certain number
// of items.
define('CII_THEME_MEMBERS_LOGOS_CLEAR_EVERY', 6);
define('CII_THEME_MEMBERS_ADVISORYBOARD_CLEAR_EVERY', 4);
/**
* Preprocess function for views list.
*
* You can figure out how this should be named by enabling devel_themer and clicking
* on items on the webpage.