This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# sudo enable-disable hack | |
# | |
# Copyright (c) 2013 "Cowboy" Ben Alman | |
# Licensed under the MIT license. | |
# http://benalman.com/about/license/ | |
if [[ "$UID" == "0" ]]; then | |
echo 'Error: Do not run this script as root or using sudo.' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// For Remy | |
function getLastScriptBySrc(filename) { | |
var scripts = document.scripts; | |
var i = scripts.length - 1; | |
while (i--) { | |
if (scripts[i].src.slice(-filename.length) === filename) { | |
return scripts[i]; | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// The idea. This doesn't work, but basically comes | |
// from https://github.com/gruntjs/grunt/pull/708 | |
var exitCode; | |
function exit(code) { | |
if (exitCode === undefined) { | |
exitcode = code || 0; | |
tryToExit(); | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* grunt | |
* http://gruntjs.com/ | |
* | |
* Copyright (c) 2013 "Cowboy" Ben Alman | |
* Licensed under the MIT license. | |
* https://github.com/gruntjs/grunt/blob/master/LICENSE-MIT | |
*/ | |
'use strict'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php?> | |
<!doctype html> | |
<html> | |
<body> | |
<link href="https://rawgithub.com/necolas/normalize.css/master/normalize.css" rel="stylesheet"> | |
<style> | |
body { | |
padding: 1em; | |
background-color: #ccc; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
{ | |
"name": "yes", | |
"message": "This question will default to yes (true).", | |
"default": true | |
}, | |
{ | |
"name": "no", | |
"message": "This question will default to no (false).", | |
"default": false |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var EventEmitter = require('events').EventEmitter; | |
var es = require('event-stream'); | |
var util = require('util'); | |
function Logger() { | |
Logger.super_.call(this); | |
} | |
util.inherits(Logger, EventEmitter); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var es = require('event-stream'); | |
var util = require('util'); | |
function Logger() { | |
this.stream = es.through(); | |
this._streamWrite = this.stream.write.bind(this.stream); | |
this._streamEnd = this.stream.end.bind(this.stream); | |
this.stream.write = this.stream.end = function() {}; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var stream = require('readable-stream'); | |
var Transform = stream.Transform; | |
function Logger() { | |
Transform.call(this); | |
} | |
Logger.prototype = Object.create(Transform.prototype); | |
Logger.prototype._transform = function(chunk, encoding, done) { | |
done(null, chunk); | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var stream = require('readable-stream'); | |
var Transform = stream.Transform; | |
var util = require('util'); | |
var _ = require('lodash'); | |
var $ = require('chalk') | |
// Just serialize a object stream into lines of JSON | |
function Serializer() { | |
Transform.call(this, {objectMode: true}); | |
} |