Skip to content

Instantly share code, notes, and snippets.

View lrobeson's full-sized avatar

Laura Robeson lrobeson

View GitHub Profile
@lrobeson
lrobeson / patternlabCopy.js
Created February 19, 2015 22:26
Grunt task to copy Pattern Lab's public directory to Drupal theme directory
// Grunt task: copy Pattern Lab's public directory to Drupal theme directory
//
// Requires: Grunt Shell (https://github.com/sindresorhus/grunt-shell)
// Usage: 'grunt shell:patternlabCopy'
shell: {
patternlabCopy: {
command:
'rsync -r patternlab/public/* public/sites/all/themes/gesso/pattern-lab'
}
@lrobeson
lrobeson / .bash_profile
Created January 2, 2015 17:58
.bash_profile for local development, optimized for Drupal
#########################
# PATHs
#########################
export PATH="/usr/local/bin:/usr/local/sbin:/usr/local/share/npm/bin:/usr/local/bin/bin:$PATH"
#########################
# Git
#########################
# Show present working directory and Git branch at prompt
@lrobeson
lrobeson / installConfig.sh
Created October 16, 2014 21:44
This script uses Homebrew, Homebrew Cask, and Dropbox to install local dev tools, dotfiles, applications, fonts, and custom configuration to a new machine.
#
# AUTOMATED SETUP ON A NEW MACHINE:
#
# This script takes care of installing local dev tools, applications, fonts,
# and copying over custom configuration.
#
# 1) Download Dropbox: https://www.dropbox.com/downloading
#
# 2) Set up Dropbox:
# - Go to Dropbox Preferences
@lrobeson
lrobeson / Gruntfile.js
Last active August 29, 2015 14:07
Grunt config for Pattern Lab: uses PL's native Watch & Live Reload, Grunt Watch task for Sass changes and Compass to compile CSS
module.exports = function (grunt) {
// Load grunt tasks automatically
require('load-grunt-tasks')(grunt);
// Time how long tasks take. Can help when optimizing build times
require('time-grunt')(grunt);
// Define the configuration for all the tasks
grunt.initConfig({
@lrobeson
lrobeson / new_file0
Created September 9, 2014 18:30
Sass snippet to apply styles if class is NOT present
&:not(.ng-hide) + .map__wrapper { // Sass :not boolean
@extend %element-hidden;
}
@lrobeson
lrobeson / config.rb
Last active August 29, 2015 14:05
Modified Compass / Sass config file with extra Dev environment option and sourcemap enabling.
# Compass / Sass config file
#
# This file is only needed for Compass/Sass integration. If you are not using
# Compass, you may safely ignore or delete this file.
# All config options: http://compass-style.org/help/documentation/configuration-reference/
# Environment setting, 3 options:
# dev_max: sourcemaps, line comments, expanded output (not ideal if committing CSS to a code repo)
# dev_min: sourcemaps and expanded output (good for theming in progress)
# production: compressed CSS with no debug info
@lrobeson
lrobeson / PhantomCSS_test_template.js
Created July 31, 2014 23:54
Test Template for PhantomCSS regression testing
/*
PhantomCSS Test Template
To use this template in a project:
- install PhantomCSS (https://github.com/Huddle/PhantomCSS)
- copy and rename this PhantomCSS_test_template.js file
cp PhantomCSS_test_template.js sitename.js
- edit the 'sitename' variable
- customize the Test Scenerio
- save the file
@lrobeson
lrobeson / SassMeister-input.scss
Created July 30, 2014 20:49
Generated by SassMeister.com.
// ----
// Sass (v3.3.12)
// Compass (v1.0.0.alpha.21)
// Breakpoint (v2.4.6)
// ----
@import "compass";
@import "breakpoint";
$fancy-breakpoint: 500px 600px, 650px;
@lrobeson
lrobeson / last_child.js
Created July 3, 2014 02:17 — forked from bytehead/last_child.js
Add last-child class in IE 8
// Add last-child class in IE 8
// source: https://gist.github.com/nathansmith/950767
function last_child() {
if (/msie [1-8]{1}[^0-9]/.test(navigator.userAgent.toLowerCase())) {
$('*:last-child').addClass('last-child');
}
}
@lrobeson
lrobeson / _grayscale.scss
Created June 16, 2014 23:52
Cross-browser grayscale filter Sass placeholder.
// @file
// Styles for: Cross-browser grayscale filter placeholder.
%grayscale {
-webkit-filter: grayscale(1); // Chrome 19+ & Safari 6+
filter: url("data:image/svg+xml;utf8,<svg xmlns=\'http://www.w3.org/2000/svg\'><filter id=\'grayscale\'><feColorMatrix type=\'matrix\' values=\'0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0 0 0 1 0\'/></filter></svg>#grayscale"); // Firefox 3.5+
filter: gray; // IE 6-9
}