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 / custom.theme.php
Last active December 7, 2022 12:28 — forked from krisrobinson/custom.theme.php
Drupal 8 check paragraph bundles and print out view modes in node.hml.twig
<?php
use Drupal\paragraphs\Entity\Paragraph;
/**
* Implements template_preprocess_node
*
* Add variables for paragraphs available to node templates
*/
function CUSTOM_preprocess_node(&$variables) {
// Convenience Variables
@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"
},
{
@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
<?php
namespace Drupal\custom_layout\Plugin\Layout;
use Drupal\Core\Form\FormStateInterface;
use Drupal\Core\Layout\LayoutDefault;
use Drupal\Core\Plugin\PluginFormInterface;
/**
* Configurable two column layout plugin class.
@danny-englander
danny-englander / cloudSettings
Last active October 1, 2020 13:18
Custom Docksal bash script (command) to install RVM, NVM, Yarn, Gulp, and jekyll
{"lastUpload":"2020-10-01T13:18:46.865Z","extensionVersion":"v3.4.3"}
#!/usr/bin/env bash
# Place this in your project at /.docksal/commands and call this file rvm, the name should match the command.
# Run this script as fin rvm.
# Install RVM and dependancies, activate and source it, choose the version.
# These two lines are needed to have a valid RVM install
fin exec bash -c "curl -#LO https://rvm.io/mpapis.asc"
@danny-englander
danny-englander / uikit-icons.yml
Last active March 4, 2017 18:33
UIKit 3 icon listing in yaml format
- name: home
category: app
- name: sign-out
category: app
- name: sign-in
category: app
- name: user
category: app
- name: users
category: app
@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 %}
// Include gulp
var gulp = require('gulp');
// Include plugins
var jshint = require('gulp-jshint'),
plumber = require('gulp-plumber'),
sass = require('gulp-sass'),
spritesmith = require('gulp.spritesmith'),
uglify = require('gulp-uglify'),
concat = require('gulp-concat'),
@danny-englander
danny-englander / zsh-backup.sh
Last active September 1, 2016 14:52
An automated drush backup script with folder pruning using ZSH Globbing
#! /bin/zsh
## An automated Drupal backup script using Drush and ZSH globbing.
## Ideally place this script in usr/local/bin
## Set this to run via a cronjob.
## Easy crontab setup: http://crontab-generator.org
## Inspiration from: by https://www.drupal.org/node/470114