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 / drupal-sf-touch.js
Created September 13, 2012 00:38 — forked from dougalcampbell/drupal-sf-touch.js
Make Drupal Superfish dropdowns touch-friendly (for Drupal 7)
// adapted from: http://snippets.webaware.com.au/snippets/make-css-drop-down-menus-work-on-touch-devices/
// forked from https://gist.github.com/3351233
(function ($) {
//add new drupal 7 code
Drupal.behaviors.touchdevice_dropdowns = {
attach:function (context, settings) {
//end drupal calls
<?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:
<?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";
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',
// -----------
// 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
danny-englander / magnific-popup-deep-linking.js
Created October 28, 2015 14:41 — forked from sadortun/magnific-popup-deep-linking.js
Deep Linking with Magnificent popup
<script type="text/javascript">
function loadGalleryDeepLink()
{
var prefix = "#gallery-";
var h = location.hash;
if (document.g_magnific_hash_loaded === undefined && h.indexOf(prefix) === 0)
var gulp = require('gulp'),
sass = require('gulp-ruby-sass'),
spritesmith = require('gulp.spritesmith'),
compass = require('gulp-compass'),
path = require('path'),
minifyCss = require('gulp-minify-css'),
browserSync = require('browser-sync'),
tinypng = require('gulp-tinypng'),
autoprefixer = require('gulp-autoprefixer'),
plumber = require('gulp-plumber');
@danny-englander
danny-englander / field.html.twig
Created December 21, 2016 14:49 — forked from lewisnyman/field.html.twig
minimal field.html.twig — Drupal 8
{% for item in items %}
{{ item.content }}
{% endfor %}
@danny-englander
danny-englander / xdebug_lando_phpstorm.md
Last active March 29, 2024 15:03 — forked from miloskroulik/xdebug_lando_phpstorm.md
How to setup xdebug + Lando + PHPstorm when using Drupal 8/9 recipe

This assumes you are using a Drupal 8 or Drupal 9 recipe and Mac OS. Also, xdebug 3.x is assumed, which is standard for Lando-provided PHP image.

Set up Lando

Example .lando.yml file can look like this:

name: xdebug-test
recipe: drupal8
config:
 webroot: web
@danny-englander
danny-englander / nunjucks-multilevel-navigation
Created May 5, 2022 19:32 — forked from benald/nunjucks-multilevel-navigation
Nunjucks Multi Level Navigation Template
// JSON Structure
[{
"title": "Home",
"name": "index"
},
{
"title": "Find a service",
"name": "find a service"
},
{