Skip to content

Instantly share code, notes, and snippets.

@thgaskell
thgaskell / Gulpfile.js
Created March 25, 2014 15:02
Creates a mini development environment for serving static content.
var gulp = require('gulp'),
gutil = require('gulp-util');
var paths = {
css: 'assets/css/**/*.css',
html: 'assets/html/**/*.html',
js: 'assets/js/**/*.js',
img: 'assets/images/**/*.{png,jpg,jpeg,gif}'
};
@thgaskell
thgaskell / Class.js
Created November 13, 2013 02:42
Mimic Java classes using closures and object properties.
var Class =
// Create a closure with an Immediately-Invoked Function Expression (IIFE)
(function () {
(function _init() {
// Similar to a static initializer in Java
// This is optional, but it prevents polluting the Class scope.
})();
// Private static variable
var _static;