Skip to content

Instantly share code, notes, and snippets.

View shakyShane's full-sized avatar

Shane Osbourne shakyShane

View GitHub Profile

staunch

loyal, firm, and dependable - solid or substantial in construction

Staunch is a highly opinionated Redux-style state management system for large-scale apps. Powered by ImmutableJS & RxJS - plug it into any codebase.

Install

Note, RxJS & ImmutableJS are requirements, you'll need to install them separately.

####Resize all JPEGs in the current folder to a 760px width, preserve aspect ratio mogrify -resize 760x *.jpg

####Crop the bottom 20% of all images in the current folder mogrify -gravity north -crop 100x80% +repage *.jpg

####Lower quality to 60% on all files mogrify -quality 60 *.jpg

####Invert colours

RewriteEngine on
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule (.*) - [L]
RewriteRule ^(.*)$ http://www.domain.com/media/$1
module.exports = function(grunt) {
// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
// Watch
watch: {
options: {
cwd: 'httpdocs/',
var gulp = require('gulp');
var sass = require('gulp-sass');
var browserSync = require('browser-sync');
var theme = './wp/wp-content/themes/lostco';
gulp.task('sass', function() {
gulp.src(theme +'/scss/*.scss')
.pipe(sass())
.pipe(gulp.dest(theme));
// ----------------------------------------------------------
// A short snippet for detecting versions of IE in JavaScript
// without resorting to user-agent sniffing
// ----------------------------------------------------------
// If you're not in IE (or IE version is less than 5) then:
// ie === undefined
// If you're in IE (>=5) then you can determine which version:
// ie === 7; // IE7
// Thus, to detect IE:
// if (ie) {}