Skip to content

Instantly share code, notes, and snippets.

@robballou
robballou / gist:a7aa247aa7bdfb3a1b2c
Last active July 8, 2021 09:54
Example stub-content function for Drupal Migrate with YAML files
<?php
/**
* Implements hook_drush_command().
*/
function example_drush_command() {
$commands = array();
$commands['stub-content'] = array(
'callback' => 'drush_stub_content',
@freshyill
freshyill / gulpfile.js
Last active May 30, 2018 23:15
Gulp-Pattern Lab Helper
//
// Paths
//
var basePaths = {
src: 'source/',
dest: 'source/'
};
var paths = {
@rachellawson
rachellawson / fullwidth.css
Last active September 3, 2015 12:05
to use <p class="wide">something</p>
//add <p class="wide"> to make a <p> stretch a grey background across full width
.wide {
background-color: #aaa;
position: relative;
padding: 20px 0;
}
.wide:before,
.wide:after {
content: ' ';
@mikedugan
mikedugan / gulpfile.js
Created June 23, 2014 01:44
Basic gulpfile setup to minify images, LESS/CSS, and JS
var gulp = require('gulp');
var rimraf = require('rimraf');
var less = require('gulp-less');
var concat = require('gulp-concat');
var prefixer = require('gulp-autoprefixer');
var cssmin = require('gulp-minify-css');
var jsmin = require('gulp-uglify');
var watch = require('gulp-watch');
var util = require('gulp-util');
var rename = require('gulp-rename');
@remy
remy / html-slides-to-pdf.js
Created June 13, 2014 21:38
Converts HTML slides (usually via reveal) to a PDF - useful for video editing
/*global console:true, phantom:true, slidedeck:true*/
var webpage = require('webpage'),
page = webpage.create(),
system = require('system'),
url = system.args[1] || 'index.html',
fs = require('fs'),
imageSources = [],
imageTags,
width = system.args[2] || 1920,
<?php
/**
* Implements hook_theme().
*/
function ds_extras_tokens_theme() {
// Declare our own theme hook, to add to the
// theme_hook_suggestions for 'field'
return array(
@soheilhy
soheilhy / nginxproxy.md
Last active July 5, 2025 15:29
How to proxy web apps using nginx?

Virtual Hosts on nginx (CSC309)

When hosting our web applications, we often have one public IP address (i.e., an IP address visible to the outside world) using which we want to host multiple web apps. For example, one may wants to host three different web apps respectively for example1.com, example2.com, and example1.com/images on the same machine using a single IP address.

How can we do that? Well, the good news is Internet browsers

@EvanAgee
EvanAgee / ContentTypes.feature
Created May 9, 2014 19:36
Behat test for multiple Drupal Content Types
Feature: Content Type Tests
As an Administrator
I should be able to create nodes of all Content Types
@api @Env::Backend @Creator::EvanAgee
Scenario: Make sure we can create Basic Pages
Given I am logged in as a user with the "administrator" role
And I visit "node/add/page"
Then I enter "BDD TEST BASIC PAGE" for "Title"
And I attach the file "photo.jpg" to "edit-field-images-und-0-upload"
// Brightness math based on:
// http://www.nbdtech.com/Blog/archive/2008/04/27/Calculating-the-Perceived-Brightness-of-a-Color.aspx
$red-magic-number: 241;
$green-magic-number: 691;
$blue-magic-number: 68;
$brightness-divisor: $red-magic-number + $green-magic-number + $blue-magic-number;
@function brightness($color) {
// Extract color components