This file contains 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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
<meta name="viewport" content="initial-scale=1"> | |
<title>Document</title> | |
</head> | |
<body> | |
This file contains 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 gulp = require('gulp'); | |
var livereload = require('gulp-livereload'); | |
var nodemon = require('gulp-nodemon'); | |
var notify = require('gulp-notify'); | |
var sass = require('gulp-sass'); | |
var autoprefixer = require('gulp-autoprefixer'); | |
var minifyCSS = require('gulp-minify-css'); | |
var rename = require('gulp-rename'); | |
// compile scss to css, prefix, minify, save to assets/style.css |
This file contains 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
# /etc/init/testjob.conf | |
# Two basic stanzas that define purpose of job script and who created it | |
description "A test job file for experimenting with Upstart" | |
author "Ben Cooling" | |
# Run after system services and processes have already loaded (to prevent any conflict) | |
start on runlevel [2345] | |
exec echo Test Job ran at `date` >> /var/log/testjob.log |
This file contains 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
/* demonstrate process lifecycle | |
--------------------------------*/ | |
console.log('Start process'); | |
// Event is fired when user kills process (ctl+d) | |
process.on('SIGINT', function() { | |
console.log('I\'m dying.'); | |
setTimeout(function(){ | |
process.exit(1); |
This file contains 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
// method on prototype | |
function Foo(){} | |
Foo.prototype.me = function(){ return "Foo"; }; | |
function Bah(){} | |
Bah.prototype = new Foo(); | |
Bah.prototype.me = function(){ | |
return Object.getPrototypeOf(Object.getPrototypeOf(this)).me() + ' & Bah'; | |
}; |
This file contains 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
"use strict"; | |
var BbPromise = require('bluebird'); | |
function delay(ms) { | |
var deferred = BbPromise.pending(); | |
setTimeout(function(){ | |
deferred | |
.fulfill("Hello "+ ms); | |
}, ms); |
This file contains 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('stream'); | |
var a = new stream.Readable({ | |
read: function(){} | |
}); | |
var b = new stream.Transform({ | |
transform: function (chunk, encoding, done) { | |
var str = chunk.toString() + 'bah'; | |
this.push(str); |