Skip to content

Instantly share code, notes, and snippets.

View danny-englander's full-sized avatar

Danny Englander (he/him) danny-englander

View GitHub Profile
@danny-englander
danny-englander / SassMeister-input-HTML.html
Created September 23, 2014 21:38
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>
@danny-englander
danny-englander / SassMeister-input-HTML.html
Created September 23, 2014 19:59
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>
@danny-englander
danny-englander / SassMeister-input.scss
Created July 13, 2014 14:45
Generated by SassMeister.com.
// ----
// Sass (v3.3.10)
// Compass (v1.0.0.alpha.20)
// ----
$white: #fff;
$medium_gray: #999;
$sea_green: #16a085;
$pomegranate: #c0392b;
$orange: #e04604;
(function( $ ) {
equalheight = function (container) {
var currentTallest = 0,
currentRowStart = 0,
rowDivs = new Array(),
$el,
topPosition = 0;
$(container).each(function () {
@danny-englander
danny-englander / openshift-drupal-deploy
Last active June 24, 2017 04:18
OpenShift Origin Drupal Deploy Script
#!/bin/bash
# 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: http://www.panix.com/~elflord/unix/bash-tute.html
# For information about action hooks supported by OpenShift, consult the documentation:
# http://openshift.github.io/documentation/oo_user_guide.html#the-openshift-directory
// -----------
// 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() {
function urlFromHash() {
if (location.hash.substr(0, 2) != '#!') {
return null;
}
// why not location.hash? => http://stackoverflow.com/q/4835784/298479
return location.href.split('#')[1].substr(1);
}
$('#gallery').magnificPopup({
type: 'image',
<?php
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";
@danny-englander
danny-englander / info-boilerplate.txt
Last active December 22, 2015 02:49
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.
;Content Type
features[node][] = event
;View
features[views_view][] = event_organizers
;User permission
features[user_permission][] = edit own event content
;Image style
<?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: