Skip to content

Instantly share code, notes, and snippets.

View matt-bailey's full-sized avatar

Matt Bailey matt-bailey

  • GPMD
  • London, UK
View GitHub Profile
@matt-bailey
matt-bailey / gist:5815536
Created June 19, 2013 16:05
The 'watch' task in Gruntfile.js (as scaffolded by yo webapp)
grunt.initConfig({
yeoman: yeomanConfig,
watch: {
coffee: {
files: ['<%= yeoman.app %>/scripts/{,*/}*.coffee'],
tasks: ['coffee:dist']
},
coffeeTest: {
files: ['test/spec/{,*/}*.coffee'],
tasks: ['coffee:test']
@matt-bailey
matt-bailey / gist:2497771
Created April 26, 2012 08:50
Image Replacement
/* H5BP image replacement: http://nicolasgallagher.com/another-css-image-replacement-technique/ */
.ir {
font: 0/0 a;
text-shadow: none;
color: transparent;
}
@matt-bailey
matt-bailey / .stencil
Last active June 21, 2019 09:26
Example BigCommerce .stencil file
{
"normalStoreUrl": "[store-url]",
"port": 3000,
"clientId": "[client-id]",
"accessToken": "[access-token]",
"customLayouts": {
"brand": {},
"category": {},
"page": {
"style-guide.html":"/style-guide/"
@matt-bailey
matt-bailey / formstack-embed-using-postscribe.html
Created September 13, 2017 11:34
Embed a Formstack form asynchronously, using Postscribe
// https://github.com/krux/postscribe
<!-- Main form wrapper, required for styling the form -->
<div class="webform">
<!-- Empty div (must have a unique ID), into which the form will be loaded -->
<div id="formstack-bridal-appointment"></div>
<script type="text/javascript">// <![CDATA[
// Only run the code below when jQuery says the document is ready
(function($) {
// Process the form using postscribe:
// 1. Must reference the unique ID of the div above
@matt-bailey
matt-bailey / m2-setup-install.sh
Last active October 7, 2018 23:15
Example Magento 2 setup:install command
php bin/magento setup:install --base-url=http://mysite.dev --db-host=localhost --db-name=mysite --db-user=root --admin-firstname=Magento --admin-lastname=User --admin-email=my@email.com --admin-user=admin --admin-password=password123 --language=en_GB --currency=GBP --timezone=Europe/London --use-rewrites=1 --backend-frontname=admin
@matt-bailey
matt-bailey / prep-ncv-env.sh
Created April 23, 2018 13:20 — forked from kevyworks/prep-ncv-env.sh
Prepare Dev Machine for: Node Composer & Laravel Valet
# install brew
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
# update brew
brew update
# should be added by homebrew installation?
sudo chown -R `whoami`:admin /usr/local/opt
# Node Version Manager
@matt-bailey
matt-bailey / package.json
Created May 8, 2015 12:32
Bare bones package.json file
{
"name": "[project-name]",
"description": "[project-description]",
"version": "1.0.0"
}
@matt-bailey
matt-bailey / post-merge
Last active January 19, 2018 01:37
Example front-end workflow post-merge Git Hook
#/usr/bin/env bash
# git hook to run a command after `git merge` or `git pull`
# Check for changed files
changed_files="$(git diff-tree -r --name-only --no-commit-id ORIG_HEAD HEAD)"
check_run() {
echo "$changed_files" | grep --quiet "$1" && eval "$2"
}
@matt-bailey
matt-bailey / Gruntfile.js
Last active November 13, 2017 18:56
This is the example Gruntfile that goes with my tutorial on front-end flat builds and automation: http://www.gpmd.co.uk/blog/front-end-process-flat-builds-and-automation-part-3-grunt-tasks/
// Generated on 2013-06-04 using generator-webapp 0.1.7
'use strict';
var lrSnippet = require('grunt-contrib-livereload/lib/utils').livereloadSnippet;
var mountFolder = function (connect, dir) {
return connect.static(require('path').resolve(dir));
};
// # Globbing
// for performance reasons we're only matching one level down:
// 'test/spec/{,*/}*.js'
@matt-bailey
matt-bailey / magento-notifications.html
Last active September 14, 2017 07:43
Magento notification markup
<ul class="messages">
<li class="error-msg">
<ul>
<li><span>Error Message</span></li>
</ul>
</li>
<li class="success-msg">
<ul>
<li><span>Success Message</span></li>
</ul>