Skip to content

Instantly share code, notes, and snippets.

View efeminella's full-sized avatar

Eric Feminella efeminella

View GitHub Profile
@sokra
sokra / webpack.js
Last active February 11, 2024 22:54
// webpack is a module bundler
// This means webpack takes modules with dependencies
// and emits static assets representing those modules.
// dependencies can be written in CommonJs
var commonjs = require("./commonjs");
// or in AMD
define(["amd-module", "../file"], function(amdModule, file) {
// while previous constructs are sync
// this is async
@efeminella
efeminella / compress.js
Created December 16, 2012 01:23
Simple node program for js/css minification using yuicompressor
/*
* basic node program for js/css minification using yuicompressor
*
* Compress the file test.js:
* $ node compress.js ../js/test.js
* Created Minified File: ../js/test.min.js
*
* Compress the file test.css
* $ node compress.js ../css/test.css
* Created Minified File: ../css/test.min.css
/* Matches all <em> elements which are the next sibling of a <strong> element */
strong + em {
    /* declarations */
}
@efeminella
efeminella / gist:2008471
Created March 9, 2012 20:21
Simple boilerplate Node Minification with uglify-js
/*
* Simple boilerplate Node Minification build for uglify-js
*
* Install: npm install uglify-js; cd to the this script's dir
* $ node <script-name>.js
*/
var parser = require( 'uglify-js' ).parser
, uglify = require( 'uglify-js' ).uglify
, path = require('path')
, fs = require( 'fs' )