DocPad: Minify your assets with Grunt
The following will minify your assets with grunt each time a generation write completes.
Installation
- Install Dependencies
27ms Created RTCPeerConnnection with: config: '{"iceServers":[{"url":"stun:stun.l.google.com:19302"}]}'; constraints: '{"mandatory":{"OfferToReceiveAudio":true,"OfferToReceiveVideo":true}}'. | |
85ms onSignalingStateChanged() ::, signalingstatechange | |
86ms Set session description success. | |
221ms ICE Candidate. Type:, HOST, Medium:, audio, Candidate:, a=candidate:505434299 1 udp 2113937151 192.168.1.6 61829 typ host generation 0 | |
221ms ICE Candidate. Type:, HOST, Medium:, audio, Candidate:, a=candidate:505434299 2 udp 2113937151 192.168.1.6 61829 typ host generation 0 |
test('test case', function(done) { | |
promise.method(function(result) { | |
assert.equal(result.name, 'mocha'); | |
}).then(done, done); | |
}); |
var express = require("express"); | |
// Create the API application. | |
var api = express(); | |
api.get("/v1/money", function(req, res) { | |
res.json({ "bling": "$$$" }); | |
}); | |
module.exports = api; |
The following will minify your assets with grunt each time a generation write completes.
'use strict'; | |
module.exports = function(grunt) { | |
// Override process.stdout to log the name+args of the current task before | |
// every logged line. | |
var hooker = require('hooker'); | |
var newline = true; | |
hooker.hook(process.stdout, 'write', function(str) { | |
var prefix = grunt.task.current.nameArgs; | |
if (newline && prefix && str !== '\n') { |
function settleAll(array) { | |
return when(array, function(array) { | |
var i, len, results; | |
results = []; | |
for(i = 0, len = array.length; i < len; i++) { | |
if(i in array) { | |
results[i] = when(array[i], null, identity); | |
} |
module.exports = function (grunt) { | |
require('load-grunt-tasks')(grunt); | |
grunt.initConfig({ | |
express: { | |
options: { | |
// Override defaults here | |
}, | |
web: { | |
options: { |
var assert = require('chai').assert; | |
var when = require('when'); | |
var def1 = when.defer(); | |
function getProm() { | |
return def1.promise; | |
} |
[In reply to https://news.ycombinator.com/item?id=7219005]
Here's the history, hope it helps.
I wrote the original version of the npm registry in a day or two on top of CouchDB. I built it quickly and didn't think much about scale.
Isaacs continued to improve and maintain that code. At one point he even wrote up an open standard for generic js package registries for CommonJS but they didn't seem to care (they were too busy arguing about promises).
At the time I wrote the initial code I was employed at CouchOne and we had a small CouchDB hosting platform operated by Jason Smith which is where we ran the registry free of charge. Later on, after CouchOne was aquired by Membase and became Couchbase, it decided to break off the hosting company and give/sell it to Jason Smith, which became IrisCouch.
/** | |
* @fileOverview Singleton pattern on ES6. | |
*/ | |
import logger from './logger.midd'; | |
/** | |
* The class statement. | |
* | |
*/ |