Skip to content

Instantly share code, notes, and snippets.

View bangpound's full-sized avatar

Benjamin Doherty bangpound

View GitHub Profile
@import __base.sass
!zen_first_sidebar_width ||= 210px
!zen_second_sidebar_width ||= 210px
!zen_content_width ||= 519px
!zen_gutter ||= 10px
!zen_navigation_height ||= 1.5em
!zen_page_width ||= !zen_first_sidebar_width + !zen_content_width + !zen_second_sidebar_width
/*globals Drupal,$ */
"use strict";
Drupal.behaviors.multimediaDetail = function (context) {
$('.media-item a:not(.multimedia-detail-processed)', context)
.each(function () {
// Append a special suffix to the href. Loads simple HTML elements to
// display in fancybox.
<?php
// This theme prepreocess function brands node types in specific views
// with the site name.
function alshabaka_policybriefs_preprocess_views_view_field(&$vars, $hook) {
// Use a switch statement because I may need to alter other fields too.
switch ($hook) {
case 'views_view_field__alshabaka_frontpage__type':
case 'views_view_field__alshabaka_frontpage_bottom__type':
@bangpound
bangpound / gist:352602
Created April 2, 2010 01:04
openidonly_link_alter
<?php
/**
* Implementation of hook_link_alter().
*
* When comment links are displayed, the user/register link is displayed when
* registrations are permitted. Here the $conf global is brought into context,
* the setting is captured in a local variable and the loaded value in $conf
* is changed to 0. This tricks theme('comment_post_forbidden') into displaying
* only a login link. The original value is returned to the global $conf array.
@bangpound
bangpound / jquery.infinitescroll.js
Created April 2, 2010 12:56
Infinite Scroll jQuery plugin
/*global Image, console, document, jQuery, window */
/*!
// Infinite Scroll jQuery plugin
// copyright Paul Irish, licensed GPL & MIT
// version 1.4.100211
// home and docs: http://www.infinite-scroll.com
*/
@bangpound
bangpound / _corbusier_colors.scss
Created April 2, 2010 17:52
Corbusier colors
// Source http://www.aaltocolour.com/colour/lecorbusier.asp
// LC 32.001 Crème
$corbusier_creme: #f2dda8;
// LC 32.010 Gris fer
$corbusier_gris_fer: #545559;
// LC 32.011 Gris
$corbusier_gris: #7b7a76;
@bangpound
bangpound / compass-rgbapng.rb
Created April 24, 2010 20:08
Cross-browser translucent backgrounds. Creates RGBa PNG files at compile time.
# bangpound does not know Ruby.
#
# inspired by http://www.alloycode.com/2009/6/19/fun-with-rmagick
#
# RGBa PNG method described at http://leaverou.me/2009/02/bulletproof-cross-browser-rgba-backgrounds/
module Sass::Script::Functions
def rgbapng(color)
require 'rubygems'
require "RMagick"
@import __base.sass
@import compass
$zen_first_sidebar_width: $zen_blueprint_left_units * $blueprint_grid_outer_width
$zen_second_sidebar_width: $zen_blueprint_right_units * $blueprint_grid_outer_width
$zen_content_width: $zen_blueprint_content_units * $blueprint_grid_outer_width - $blueprint_grid_margin
$zen_gutter: $blueprint_grid_margin
$zen_navbar_height: 40px
$zen_page_width: $zen_first_sidebar_width + $zen_content_width + $zen_second_sidebar_width
/*global jQuery */
"use strict";
/**
* jQuery balance plugin.
*
* Adds 1px padding to the right side of an element. If text wraps and
* causes the height of the element to increase, remove 1 pixel.
*