Skip to content

Instantly share code, notes, and snippets.


Danny Englander danny-englander

View GitHub Profile
View jquery.responsive-classes.js
* Inspired by:
* This script is ideal for getting specific class depending on device width
* for enhanced theming. Media queries are fine in most cases but sometimes
* you want to target a specific JQuery call based on width. This will work
* for that. Be sure to put it first in your script file. Note that you could
* also target the body class instead of 'html' as well.
* Modify as needed
danny-englander / drupal-sf-touch.js
Created Sep 13, 2012 — forked from dougalcampbell/drupal-sf-touch.js
Make Drupal Superfish dropdowns touch-friendly (for Drupal 7)
View drupal-sf-touch.js
// adapted from:
// forked from
(function ($) {
//add new drupal 7 code
Drupal.behaviors.touchdevice_dropdowns = {
attach:function (context, settings) {
//end drupal calls
danny-englander / Custom.js
Created Oct 31, 2012
Unique Colorbox classes for better theming
View Custom.js
$(document).ready(function (){
// element-1 and element-2 are hrefs that trigger any given colorbox
$(".element-1").click(function() {
$('#colorbox').addClass("cb1").removeClass('cb2'); //add a custom class to #colorbox
$(".element-2").click(function() {
View local.settings.php
* @file
* local.settings.php (Drupal 6.x)
* This settings file is intended to contain settings specific to a local
* development environment, by overriding options set in settings.php.
* Include this file from your regular settings.php by including this at the
* bottom:
danny-englander / info-boilerplate.txt
Last active Dec 22, 2015
A Drupal boilerplate for updating Features when you are using Drush. These are examples of code you would add to your Feature's .info file. Once you add it, simply run drush --d fu my_feature and voila, all the magic happens.
View info-boilerplate.txt
;Content Type
features[node][] = event
features[views_view][] = event_organizers
;User permission
features[user_permission][] = edit own event content
;Image style
View gist:6442459
function NAMEOFTHEME_preprocess_page(&$vars) {
// Use grouped import technique for more than 30 un-aggregated stylesheets (css limit fix for IE)
$css = drupal_add_css();
if (NAMEOFTHEME_css_count($css) > 26) {
$styles = '';
$suffix = "\n".'</style>'."\n";
foreach ($css as $media => $types) {
$prefix = '<style type="text/css" media="'. $media .'">'."\n";
View mp-history-deeplinking.js
function urlFromHash() {
if (location.hash.substr(0, 2) != '#!') {
return null;
// why not location.hash? =>
return location.href.split('#')[1].substr(1);
type: 'image',
View viewport.js
// -----------
// Debugger that shows view port size. Helps when making responsive designs.
// -----------
function showViewPortSize(display) {
if(display) {
var height = jQuery(window).height();
var width = jQuery(window).width();
jQuery('body').prepend('<div id="viewportsize" style="z-index:9999;position:fixed;top:40px;left:5px;color:#fff;background:#000;padding:10px">Height: '+height+'<br>Width: '+width+'</div>');
jQuery(window).resize(function() {
danny-englander / openshift-drupal-deploy
Last active Jun 24, 2017
OpenShift Origin Drupal Deploy Script
View openshift-drupal-deploy
# This deploy hook gets executed after dependencies are resolved and the
# build hook has been run but before the application has been started back
# up again. This script gets executed directly, so it could be python, php,
# ruby, etc.
# Bash help:
# For information about action hooks supported by OpenShift, consult the documentation:
View equalheight.js
(function( $ ) {
equalheight = function (container) {
var currentTallest = 0,
currentRowStart = 0,
rowDivs = new Array(),
topPosition = 0;
$(container).each(function () {