Skip to content

Instantly share code, notes, and snippets.

View robdecker's full-sized avatar

Rob Decker robdecker

View GitHub Profile
@robballou
robballou / closures.js
Created December 17, 2012 15:39
Code from my JavaScript Best Practices from AtenCamp 2012
// closures
(function($, Drupal, drupalSettings) {
var snow_base = 10;
Drupal.behaviors.snowman = {
attach: function() {
// can access $, Drupal, drupalSettings
}
@pascalduez
pascalduez / template.php
Last active December 23, 2015 22:39
Drupal 7 — Add JS with conditional comments
<?php
/**
* Helper function to add IE commented js files.
* Offer more placement flexibility than drupal_add_html_head.
*/
function _add_ie_js(array $scripts) {
$return = '';
foreach ($scripts as $key => $value) {
@JohnAlbin
JohnAlbin / _init.scss
Last active December 26, 2015 18:09
Handing IE8 and lower with Breakpoint + compass/support
// Initialize the Sass variables and partials used in this project.
// Set the legacy IE support variables. We override the default values set by
// the compass/support partial, but let styles-ie8.scss override these values.
$legacy-support-for-ie6 : false !default;
$legacy-support-for-ie7 : false !default; // Note the use of !default.
$legacy-support-for-ie8 : false !default;
// Partials to be shared with all .scss files.
@pixelwhip
pixelwhip / block.tpl.php
Created July 14, 2012 16:20
Modular Stylesheets - Design 4 Drupal
<?php
/**
* @file
* Default theme implementation to display a block.
*
* Available variables:
* - $block->subject: Block title.
* - $content: Block content.
* - $block->module: Module that generated the block.
@shadcn
shadcn / PANTHEON.md
Last active February 23, 2017 18:38
How to create a composer-based project on Pantheon.

How to create a composer-based project on Pantheon.

  1. Install Terminus: composer global require pantheon-systems/terminus.
  2. Head to your Pantheon dashboard, go to your Account and click on Machine Tokens.
  3. Create a new token and use it auth with Pantheon: terminus auth:login --machine-token=MACHINE-TOKEN
  4. Create a new site on Pantheon using terminus: terminus site:create name-of-site "Name of Site" 35b0e365-a191-4c70-adbe-9d02d01343f3. 35b0e365-a191-4c70-adbe-9d02d01343f3 is the uuid of the Drops 8 Composer upstream. You can see a list of upstream by running terminus upstream:list
  5. Once the site is created, you can head to http://dev-name-of-site.pantheonsite.io and continue with setup.
  6. Cloning your site on your local should give you a composer-based template.
@cweagans
cweagans / Vagrantfile
Last active June 8, 2018 20:46
Vagrantfile
# Up to date version can always be found at https://gist.github.com/cweagans/4e879a72985905e145df
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = "ubuntu/xenial64"
config.vm.synced_folder ".", "/srv", type: "nfs"
config.vm.network "private_network", ip: "192.168.205.142"
config.vm.network "forwarded_port", guest: 80, host: 8085
config.vm.provider "virtualbox" do |vb|
vb.customize ["modifyvm", :id, "--memory", "1024"]
@robdecker
robdecker / Gulpfile.js
Last active November 2, 2019 01:45
[Current Gulp setup] #gulp
'use strict';
// Include Gulp
var gulp = require('gulp'),
// Include Plug-ins
changed = require('gulp-changed'),
concat = require('gulp-concat'),
globbing = require('gulp-css-globbing'),
imagemin = require('gulp-imagemin'),
@pixelwhip
pixelwhip / magic-padding.scss
Last active April 8, 2020 17:37
Magic Padding Sass Mixin. Adds padding to all four sides of an element. Replacing bottom padding with an :after psuedo element with top margin, giving the illusion of the bottom padding collapsing with the bottom margin of the last child within the element. @params $values Same as CSS shorthand for padding Example: 10px or 1em 10px or 10px 20px …
//
// @file
// Magic Padding mixins.
//
// Replaces bottom padding with an :after psuedo element with top margin, giving
// the illusion of the bottom padding collapsing with the bottom margin of the
// last child within the element.
//
// @param $value
@mirisuzanne
mirisuzanne / keyframes-sass-output.css
Created January 13, 2012 17:37
A Keyframes Mixin (Sass only)
@-webkit-keyframes bgcolor { 0% { background-color: #ffccf2; }
50% { background-color: #ccffcc; }
100% { background-color: #ccffff; } }
@-moz-keyframes bgcolor { 0% { background-color: #ffccf2; }
50% { background-color: #ccffcc; }
100% { background-color: #ccffff; } }
@-ms-keyframes bgcolor { 0% { background-color: #ffccf2; }
50% { background-color: #ccffcc; }
# see https://www.topbug.net/blog/2013/04/14/install-and-use-gnu-command-line-tools-in-mac-os-x/
# core
brew install coreutils
# key commands
brew install binutils
brew install diffutils
brew install ed --default-names
brew install findutils --with-default-names