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
@frankbaele
frankbaele / GruntFile
Last active December 31, 2015 12:19
libsass grunt + bourbon
module.exports = function (grunt) {
"use strict";
var neat = require('node-neat').includePaths;
// Config...
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
connect: {
server: {
options: {
port: 9001,
@daraskolnick
daraskolnick / gulpfile.js
Last active March 13, 2016 17:00
Current gulpfile.js
// 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'),
resize = require('gulp-image-resize'),
uglify = require('gulp-uglify'),
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');
@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)
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',
@pascalduez
pascalduez / html.tpl.php
Created December 1, 2011 16:18
Drupal 7 — HTML5 html.tpl.php
<!DOCTYPE html>
<html<?php print $html_attributes; ?>>
<head>
<?php print $head; ?>
<title><?php print $head_title; ?></title>
<?php print $styles; ?>
<?php print $scripts; ?>
</head>
<body<?php print $body_attributes;?>>
@jacine
jacine / composer.md
Last active August 31, 2016 19:13
Composer

Composer Workflow

Composer is a package manager similar to NPM for JavaScript, but for dealing with PHP packages. We use it to manage Drupal core, contributed modules (and other 3rd party libraries needed) and patches. The following section is a quick reference for common tasks. Ensure you have installed/updated Composer before proceeding.

*Note about Git: While this will be obvious to most, it bears mentioning that after you're finished installing, updating or patching with Composer, you'll need to add the changes/additions to version control.

Contributed Modules

Note: When a specific version isn't specified, composer prefers stable over RC over beta over alpha over DEV releases.

@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
@manumilou
manumilou / main_menu.module
Created October 8, 2014 15:25
drupal\features : Delete all menu links before reverting a feature
/**
* Implements hook_pre_features_revert().
*
* If a menu link is added in a menu handled by this feature, it won't be deleted when the menu feature is reverted.
* Only the menu links exported in the feature will be reverted.
* Implementing this hook allows us to make sure that the menu is fully resetted after the revert
* by first deleting all menu links before reverting.
*/
function main_menu_pre_features_revert($component) {
if($component == 'menu_links') {
@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