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
@jacine
jacine / setup.md
Last active September 24, 2016 15:14
Drupal 8 setup

Drupal 8 Setup

  1. Copy sites/default/default.settings.php, renaming to sites/default/settings.local.php.
  2. Copy sites/default/development.services.yml, renaming to sites/default/services.yml.

Changes in settings.local.php:

@todo Write out details. https://gist.github.com/jacine/4520c74beb5b77ef5af8

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');
@laurentsab
laurentsab / twig_merge_attributes
Created January 20, 2016 09:02
Twig merge attributes
// parent_template.html.twig
{% include "AppBundle:fields:input_text.html.twig" with {
'form_id': form_id,
'field_name': 'Numéro',
'required': true,
'attr': {
'data-minlength': '\\d{7}',
'minlength': '7',
'maxlength': '7',
'data-error': 'e0.message_error'|trans()
@c-vetter
c-vetter / gulp-watch-ng-annotate-lazypipe-fix.js
Created December 14, 2015 13:06
Using gulp-ng-annotate with lazypipe inside gulp-watch without triggering tasks still crashes even with plumber. This setup results in a continuous pipe setup resilient against syntax errors with very little overhead.
var gulp = require('gulp')
var gulpIf = require('gulp-if')
var gulpNgAnnotate = require('gulp-ng-annotate')
var gulpPlumber = require('gulp-plumber')
var gulpWatch = require('gulp-watch')
var lazypipe = require('lazypipe')
var processPipe
gulp.task('watch-annotate', watch)
@zellwk
zellwk / gulpfile.js
Last active February 3, 2019 21:57
Gulpfile-development-phase
var gulp = require('gulp');
var sass = require('gulp-sass');
var plumber = require('gulp-plumber');
var notify = require('gulp-notify');
var browserSync = require('browser-sync');
var autoprefixer = require('gulp-autoprefixer');
var sourcemaps = require('gulp-sourcemaps');
var spritesmith = require('gulp.spritesmith');
var gulpIf = require('gulp-if');
var nunjucksRender = require('gulp-nunjucks-render');
@Phlow
Phlow / for-loop-sorted-collection
Last active April 30, 2024 13:30
This Liquid loop for Jekyll sorts a collection by date in reverse order
{% comment %}
*
* This loop loops through a collection called `collection_name`
* and sorts it by the front matter variable `date` and than filters
* the collection with `reverse` in reverse order
*
* To make it work you first have to assign the data to a new string
* called `sorted`.
*
{% endcomment %}
@aFarkas
aFarkas / focus-within.js
Last active August 20, 2020 10:49
simple focus-within polyfill
(function(window, document){
'use strict';
var slice = [].slice;
var removeClass = function(elem){
elem.classList.remove('focus-within');
};
var update = (function(){
var running, last;
var action = function(){
var element = document.activeElement;
@petebrowne
petebrowne / bem.scss
Created March 5, 2015 17:35
BEM Mixins
// BEM mixins for laying out modules.
// Based on:
//
// https://medium.com/@marcmintel/pushing-bem-to-the-next-level-with-sass-3-4-5239d2371321
$element-separator: '__' !default;
$modifier-separator: '--' !default;
// Creates a "block" in a BEM module.
//
@jibran
jibran / terms_from_term.inc
Last active August 29, 2015 14:15
Plugin to provide an relationship handler for all terms from term. plugins/relationships/terms_from_term.inc
<?php
/**
* @file
* Plugin to provide an relationship handler for all terms from term.
*/
/**
* Plugins are described by creating a $plugin array which will be used
* by the system that includes this file.
@AllThingsSmitty
AllThingsSmitty / accessible-menu.css
Last active October 1, 2021 14:42
Accessible dropdown menu
/* Top level nav */
.nav {
float: left;
margin: 20px 0;
}
/* Dropdowns */
.nav ul {
position: absolute;
top: 2.5em;