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:3667087
Created September 7, 2012 15:18
Terminal - Secure Copy file
# Copy file from local to remote server (reverse to copy the other way)
scp [filename] [user]@[remote-server]:/tmp/
@matt-bailey
matt-bailey / gist:3667136
Created September 7, 2012 15:23
Terminal - List files
# options - long list, show all
ls -la
# options - long list, reverse order, sort by modification time
ls -lrt
# Print working directory
pwd
@matt-bailey
matt-bailey / gist:3911666
Created October 18, 2012 13:05
Sass vs Less - Placeholders
// Source: http://ianstormtaylor.com/oocss-plus-sass-is-the-best-way-to-css/
// Sass
%separator
border-top: 1px solid black
hr
@extend %separator
.separator
@extend %separator
# To compress
tar -zcvf archive_name.tar.gz folder_to_compress
# To extract
tar -zxvf archive_name.tar.gz
@matt-bailey
matt-bailey / yo webapp output
Last active December 16, 2015 16:59
yo webapp output
Out of the box I include HTML5 Boilerplate, jQuery and Modernizr.
Would you like to include Twitter Bootstrap for Sass? (Y/n)
Would you like to include RequireJS (for AMD support)? (Y/n)
create Gruntfile.js
create package.json
create .gitignore
create .gitattributes
create .bowerrc
create component.json
create .jshintrc
@matt-bailey
matt-bailey / grunt --force output
Created April 26, 2013 13:36
Output when running 'grunt --force'
>> Local Npm module "grunt-mocha" not found. Is it installed?
Running "jshint:all" (jshint) task
>> 4 files lint free.
Warning: Task "mocha" not found. Used --force, continuing.
Running "clean:dist" (clean) task
Running "useminPrepare:html" (useminPrepare) task
Going through app/index.html to update the config
@matt-bailey
matt-bailey / gist:5765024
Created June 12, 2013 13:00
How to install Yeoman
npm install -g yo grunt-cli bower
@matt-bailey
matt-bailey / gist:5765048
Created June 12, 2013 13:04
Yeoman - Yo webapp generator directory structure
myproject/
|-- .sass-cache/
|-- .tmp/
|-- app/
| |-- components/
| |-- images/
| |-- scripts/
| `-- styles/
|-- dist/
| |-- components/
@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 / 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'