The following will minify your assets with grunt each time a generation write completes.
- Install Dependencies
| // XORCipher - Super simple encryption using XOR and Base64 | |
| // | |
| // Depends on [Underscore](http://underscorejs.org/). | |
| // | |
| // As a warning, this is **not** a secure encryption algorythm. It uses a very | |
| // simplistic keystore and will be easy to crack. | |
| // | |
| // The Base64 algorythm is a modification of the one used in phpjs.org | |
| // * http://phpjs.org/functions/base64_encode/ | |
| // * http://phpjs.org/functions/base64_decode/ |
| // sign up | |
| account.signUp('[email protected]', 'secret'); | |
| // sign in | |
| account.signIn('[email protected]', 'secret'); | |
| // sign in via oauth | |
| account.signInWith('twitter'); | |
| // sign out |
| /*global module:false*/ | |
| module.exports = function(grunt) { | |
| // Load tasks | |
| grunt.loadTasks('util/grunt'); | |
| // Load vendors tasks | |
| grunt.loadNpmTasks('grunt-contrib-compass'); | |
| grunt.loadNpmTasks('grunt-contrib-uglify'); | |
| grunt.loadNpmTasks('grunt-contrib-jshint'); | |
| grunt.loadNpmTasks('grunt-contrib-watch'); |
| <!DOCTYPE html> | |
| <meta charset=utf-8 /> | |
| <title>Defining JavaScript functions, the ES6 way</title> | |
| <h1>Defining JavaScript functions, the ES6 way</h1> | |
| <em>Use Firefox 22 (Firefox Nightly)</em> | |
| <script> |
| function whichTransitionEvent(){ | |
| var t; | |
| var el = document.createElement('fakeelement'); | |
| var transitions = { | |
| 'transition':'transitionend', | |
| 'MSTransition':'msTransitionEnd', | |
| 'MozTransition':'transitionend', | |
| 'WebkitTransition':'webkitTransitionEnd' | |
| } |
| /** | |
| * Task: attach_heads | |
| * Description: Set the heads for all themes declared in themes.json | |
| */ | |
| module.exports = function(grunt) { | |
| 'use strict'; | |
| var fs = require('fs'); | |
| var path = require('path'); |
| // parse a given template and repalce any variables wrapped with brackets '{' & '}' with the | |
| // corresponding object found in the passed context param | |
| // * **param:** {string} template sting template to be parsed | |
| // * **param:** {object} context object containing variables to inject into the template | |
| // | |
| // e.g: parse( 'hello my name is {name}, I am a {title}', { | |
| // name: 'Anas Nakawa' | |
| // title: function() { | |
| // return 'software developer' | |
| // } |
| /*global module:false*/ | |
| module.exports = function(grunt) { | |
| // Project configuration. | |
| grunt.initConfig({ | |
| // Metadata. | |
| pkg: grunt.file.readJSON('package.json'), | |
| aws: grunt.file.readJSON('config/grunt-aws.json'), | |
| datetime: Date.now(), | |
| jshint: { |
| /*global module:false*/ | |
| module.exports = function(grunt) { | |
| // Project configuration. | |
| grunt.initConfig({ | |
| pkg: '<json:package.json>', | |
| meta: { | |
| banner: '/*! <%= pkg.title || pkg.name %> - v<%= pkg.version %> - ' + | |
| '<%= grunt.template.today("yyyy-mm-dd") %>\n' + | |
| '<%= pkg.homepage ? "* " + pkg.homepage + "\n" : "" %>' + |
The following will minify your assets with grunt each time a generation write completes.