Skip to content

Instantly share code, notes, and snippets.

View cbourdage's full-sized avatar

Collin Bourdage cbourdage

View GitHub Profile
@cbourdage
cbourdage / gulpfile.js
Created September 25, 2016 17:25
Gulp + watchify + browserify + babelify
var gulp = require('gulp');
var gutil = require('gulp-util');
var guglify = require('gulp-uglify');
var source = require('vinyl-source-stream');
var buffer = require('vinyl-buffer');
var browserify = require('browserify');
var watchify = require('watchify');
var babelify = require('babelify');
var colors = {
@cbourdage
cbourdage / wc-r.txt
Created January 28, 2016 21:50
word counts recursive
grep '' -IR . | wc -l
@cbourdage
cbourdage / Gruntfile.js
Last active October 22, 2015 18:59
Gruntfile specifically designed and optimized for Magento EE 1.13
module.exports = function (grunt) {
var Config = {
_assetsRoot: 'skin/frontend/theme/default/',
_inStoreAssetsRoot: 'skin/frontend/instore/default/',
errorReplaceOptions: {
patterns: [{
match: /\.\.\/fonts\//g,
@cbourdage
cbourdage / git-prune-delete.txt
Created October 7, 2015 18:40
prune + delete local branches no longer used
git branch -vv | grep ': gone]' | awk '{print $1}' | xargs git branch -d
@cbourdage
cbourdage / increment.js
Created July 6, 2015 20:01
html incrementing js
$('.merrits').find('.num')
.each(function() {
// set each .num back to zero and add a class to look for
var $t = $(this);
$t.data('number', $t.html());
$t.html('0');
})
.on('in.Inview', function() {
$(this).data('interval', window.setInterval($.proxy(function() {
var $t = $(this),
@cbourdage
cbourdage / flush-all-of-it.txt
Created July 2, 2015 13:40
flushing redis and memcached from vm
vagrant ssh
redis-cli flushall
telnet localhost 11211
flush_all
(okay will display)
quit
@cbourdage
cbourdage / rating-loop.less
Created July 1, 2015 22:48
ratings loop
.rating-box {
display: inline-block;
line-height: 1.8;
margin-right: 5px;
vertical-align: top;
.loop(@total, @i:1) when (@i =< (@total)) {
&.rating-@{i} {
.rating {
@cbourdage
cbourdage / url-replacement-grunt.js
Created April 13, 2015 18:37
sample grunt configuration for url replacement
// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
// Build out replacements for error files
replace: {
build: {
options: {
patterns: [{
match: /\.\.\/fonts\//g,
@cbourdage
cbourdage / image-min-grunt.js
Created April 13, 2015 18:27
sample grunt configuration for image minification
// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
imagemin: {
skinpng: {
options: {
progressive: 6
},
files: [{
@cbourdage
cbourdage / js-minification-grunt.js
Created April 13, 2015 18:25
sample grunt configuration for js combining/minification
// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
clean: {
js: [
'js/gorilla/deploy/*.js',
'js/gorilla/plugins.js'
]
},