Skip to content

Instantly share code, notes, and snippets.

View pixelwhip's full-sized avatar

John Ferris pixelwhip

View GitHub Profile
@pixelwhip
pixelwhip / recipes-include-sparse-fieldsets.json
Last active December 13, 2021 13:05
Contenta Recipe Response
{
"data": [
{
"type": "recipes",
"id": "d977783a-d277-4f55-b8a7-af57b188ab6e",
"attributes": {
"title": "Frankfurter salad with mustard dressing"
},
"relationships": {
"category": {
@pixelwhip
pixelwhip / MODULE_NAME.module
Created December 6, 2012 23:05
Custom Block code for Drupal 7
<?php
/**
* Implements hook_block_info().
*/
function MODULE_NAME_block_info() {
$blocks['BLOCK_DELTA'] = array(
'info' => t(''),
'cache' => DRUPAL_NO_CACHE,
);
@pixelwhip
pixelwhip / magic-padding.scss
Last active April 8, 2020 17:37
Magic Padding Sass Mixin. Adds padding to all four sides of an element. Replacing bottom padding with an :after psuedo element with top margin, giving the illusion of the bottom padding collapsing with the bottom margin of the last child within the element. @params $values Same as CSS shorthand for padding Example: 10px or 1em 10px or 10px 20px …
//
// @file
// Magic Padding mixins.
//
// Replaces bottom padding with an :after psuedo element with top margin, giving
// the illusion of the bottom padding collapsing with the bottom margin of the
// last child within the element.
//
// @param $value
@pixelwhip
pixelwhip / template.php
Created May 30, 2012 13:26
Adding icons to menu links in Drupal
<?php
/**
* Custom implementation of theme_menu_link() for including icons.
*/
function cic_menu_link__icon(array $variables) {
$element = $variables['element'];
$sub_menu = '';
/* Prevent the <span> tag from being escaped */
@pixelwhip
pixelwhip / block.tpl.php
Created July 14, 2012 16:20
Modular Stylesheets - Design 4 Drupal
<?php
/**
* @file
* Default theme implementation to display a block.
*
* Available variables:
* - $block->subject: Block title.
* - $content: Block content.
* - $block->module: Module that generated the block.
/*
* toggle.js
*/
var logger = require('./logger'),
log = logger.log,
$ = require('jquery');
var toggle = function() {
/**
@pixelwhip
pixelwhip / SassMeister-input-HTML.html
Created October 23, 2013 21:53
Generated by SassMeister.com.
<div id="swatch-1"></div>
<div id="swatch-2"></div>
<div id="swatch-3"></div>
<div id="swatch-4"></div>
@import "singularitygs";
// Singularity Settings
$grids: 3;
$gutters: 0;
$output: 'isolation';
///
$direction: 'rtl';
.rtl {
@include grid-span(2, 1);
@pixelwhip
pixelwhip / SassMeister-input-HTML.html
Created October 14, 2013 00:18
Generated by SassMeister.com.
<header class="brand">
<img src="" class="brand-logo"/>
<h1 class="brand-name">The Sass Way</h1>
<p class="brand-price">5/6</p>
</header>
<div class="cover">
<h1 class="cover-title">The Marber Grid</h1>
<cite class="cover-author">Singularity GS</cite>
</div>
@pixelwhip
pixelwhip / _l-3up.scss
Created July 7, 2013 23:57
Drupal cTools/panels custom layout. Creating dynamic layout classes based on whether or not regions have content.
//
// @file
// Sidebars After Layout.
// One main content area with two sidebars after.
// ----------------------------------------------------------------------------
.l--3up {
@include breakpoint(41em, $no-query: '.lt-ie9') {
.l-main {
@include zen-grid-item(8, 1);