Skip to content

Instantly share code, notes, and snippets.

View pixelwhip's full-sized avatar

John Ferris pixelwhip

View GitHub Profile
@pixelwhip
pixelwhip / SassMeister-input-HTML.html
Created February 14, 2014 18:34
Generated by SassMeister.com.
<H2>Compass Browser Support</H2>
@pixelwhip
pixelwhip / drupal-center.css
Created February 25, 2014 22:57
This includes all the minified CSS included in a base install of the Center theme. It's helpful as a baseline for use in style guides.
#comments{margin-top:15px;}.indented{margin-left:25px;}.comment-unpublished{background-color:#fff4f4;}.comment-preview{background-color:#ffffea;}
.container-inline-date{clear:both;}.container-inline-date .form-item{float:none;margin:0;padding:0;}.container-inline-date > .form-item{display:inline-block;margin-right:0.5em;margin-bottom:10px;vertical-align:top;}.container-inline-date .form-item .form-item{float:left;}.container-inline-date .form-item,.container-inline-date .form-item input{width:auto;}.container-inline-date .description{clear:both;}.container-inline-date .form-item input,.container-inline-date .form-item select,.container-inline-date .form-item option{margin-right:5px;}.container-inline-date .date-spacer{margin-left:-5px;}.views-right-60 .container-inline-date div{margin:0;padding:0;}.container-inline-date .date-timezone .form-item{clear:both;float:none;width:auto;}.container-inline-date .date-padding{padding:10px;float:left;}.views-exposed-form .container-inline-date .date-padding{padding:0;}#c
@pixelwhip
pixelwhip / SassMeister-input.scss
Created September 8, 2014 16:59
Generated by SassMeister.com.
// ----
// Sass (v3.4.3)
// Compass (v1.0.1)
// ----
// Failed attempt to create a shortcut for writing AMCSS selectors.
// Tried several approaches and all end up being more characters than just
// typing out the selector. Also, unwarranted complexity.
//
// You win this time, Vanilla CSS.
@pixelwhip
pixelwhip / template.php
Last active August 29, 2015 14:08
Grunticon snippet for a Drupal theme.
<?php
/**
* Implements hook_preprocess_html().
*/
function [theme_name]_preprocess_html(&$vars) {
/**
* Add Grunticon stylesheet loader.
*/
/**
* Implements hook_block_view_alter().
*/
function ex_user_block_view_masquerade_masquerade_alter(&$data, $block) {
// Allow the block to be hidden using a conf variable.
if (!variable_get('ex_user_show_masquerade_block', 1)) {
$data = array();
return;
}
/**
* Implements hook_block_view_MODULE_DELTA_alter().
*/
function ex_user_block_view_masquerade_masquerade_alter(&$data, $block) {
// Allow the block to be hidden using a conf variable.
if (!variable_get('ex_user_show_masquerade_block', 1)) {
$data = array();
return;
}
@pixelwhip
pixelwhip / element.inc
Created February 25, 2012 23:44
Creates an element object as a basis for a more consistent render array.
<?php
/**
* @file
* Creates an element object as a basis for a more consistent render array.
*
* The current Drupal 7 render array is very powerful but hard to manage due to
* inconsistencies and information overload. This proof of concept aims to
* create a better separation between what is meant to be rendered and what is
* extra contextual information used by module developers. It tries to strike
* a balance between flexibility and discoverability. The general idea is
@pixelwhip
pixelwhip / android-background.patch
Created March 1, 2012 15:06
Fixes the background image issue on the Galaxy Nexus
=== modified file 'sites/all/themes/denver2012/sass/screen.scss'
--- sites/all/themes/denver2012/sass/screen.scss 2012-02-22 07:13:16 +0000
+++ sites/all/themes/denver2012/sass/screen.scss 2012-02-29 18:55:13 +0000
@@ -965,7 +973,7 @@
#wrapper {
position: relative;
- z-index: 0;
+ z-index: 1;
}
@pixelwhip
pixelwhip / styleguide.html
Created March 7, 2012 23:52
A style guide to use as a basis for styling basic html tags.
<!-- Quick & Dirty Style Guide -->
<!-- Paste this into the body of a node to give you something to style. -->
<!-- by John Ferris @pixel_whip http://pixel-whip.com -->
<p class="intro">Intro Paragraph Style: It’s helpful to give your readers a quick introduction to the page. That’s what this paragraph will do for them.</p>
<h2>Section Heading (h2)</h2>
<img src="http://placekitten.com/600/288" />
<p><img src="http://placekitten.com/340/240" class="image-left"/>Basic Paragraph Style: Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, this is a link quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Lorem ipsum dolor sit amet, this is a visited link consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. </p>
<p><img src="http://placekitten.com/216/216" class="image-right"/>Ut enim ad minim veniam, quis nostrud exercitation this is a link
@pixelwhip
pixelwhip / template.php
Created April 18, 2012 05:43
This is simple alter function I had to write while addressing an issue on the DrupalCon site. It led to this blog post. http://pixel-whip.com/blog/12/03/all-cool-kids-back-bus
<?php
/**
* Implements hook_js_alter()
*/
function shizzle_js_alter(&$javascript) {
// Collect the scripts we want in to remain in the header scope.
$header_scripts = array(
'sites/all/libraries/modernizr/modernizr.min.js',
);