mkdir -p /usr/local/etc/nginx/sites-{enabled,available}
File locations:
nginx.conf
to/usr/local/etc/nginx/
default
anddefault-ssl
to/usr/local/etc/nginx/sites-available
homebrew.mxcl.nginx.plist
to/Library/LaunchDaemons/
using System; | |
using System.Collections.Concurrent; | |
using System.Threading; | |
using System.Threading.Tasks; | |
using System.Threading.Tasks.Dataflow; | |
namespace TDFDemo | |
{ | |
class Program | |
{ |
// Dependency resolution, adapted from https://gist.github.com/1232505/f16308bc14966c8d003c2686b1c258ec41303c1f | |
function resolve(graph) { | |
var sorted = [], // sorted list of IDs ( returned value ) | |
visited = {}; // hash: id of already visited node => true | |
// 2. topological sort | |
Object.keys(graph).forEach(function visit(name, ancestors) { | |
if (!Array.isArray(ancestors)) ancestors = []; | |
ancestors.push(name); | |
visited[name] = true; |
// Dependency resolution, adapted from https://gist.github.com/1232505/f16308bc14966c8d003c2686b1c258ec41303c1f | |
function resolve(graph) { | |
var sorted = [], // sorted list of IDs ( returned value ) | |
visited = {}; // hash: id of already visited node => true | |
// 2. topological sort | |
Object.keys(graph).forEach(function visit(name, ancestors) { | |
if (!Array.isArray(ancestors)) ancestors = []; | |
ancestors.push(name); | |
visited[name] = true; |
mkdir -p /usr/local/etc/nginx/sites-{enabled,available}
File locations:
nginx.conf
to /usr/local/etc/nginx/
default
and default-ssl
to /usr/local/etc/nginx/sites-available
homebrew.mxcl.nginx.plist
to /Library/LaunchDaemons/
[merge] | |
keepBackup = false | |
tool = p4merge | |
[mergetool "p4merge"] | |
cmd = /Applications/p4merge.app/Contents/Resources/launchp4merge "\"$PWD/$BASE\"" "\"$PWD/$REMOTE\"" "\"$PWD/$LOCAL\"" "\"$PWD/$MERGED\"" | |
keepTemporaries = false | |
trustExitCode = false | |
keepBackup = false | |
[diff] | |
tool = p4merge |
const RxNode = require('rx-node'); | |
const Rx = require('rx'); | |
const spawn = require('child_process').spawn; | |
RxNode.fromStream(spawn('find', ['/','-type','f','-exec', 'cat', '{}', '\+']).stdout) | |
.map(x => x.toString()) | |
.map(x => RxNode.fromStream(spawn('./word-count.js', [x]).stdout)) | |
.mergeAll() | |
.map(x => x.toString()) | |
.do(x => console.log(x)) |
Our Virtual Machines are provisioned using Vagrant from a Linux base box to run using VirutalBox. If the Hard Disk space runs out and you cannot remove files to free-up space, you can resize the Hard Disk using some VirtualBox and Linux commands.
The following steps assume you've got a set-up like mine, where:
var cluster = require('cluster'); | |
if (cluster.isWorker) { | |
console.log('Worker ' + process.pid + ' has started.'); | |
// Send message to master process. | |
process.send({msgFromWorker: 'This is from worker ' + process.pid + '.'}) | |
// Receive messages from the master process. |
#!/bin/env node | |
//thx to http://fsprojects.github.io/Chessie/a-tale-of-3-nightclubs.html | |
Promise.all([ | |
suitablePersonEnterGayBar(), | |
unsuitablePersonEnterGayBar(), | |
]) | |
.then(result => result.map((person, i) => `Person ${i+1}: ${person.cost || ''}${person.reasons.join(' ')}`)) | |
.then(result => console.log(`Person entries\n${result.join('\n')}`)); |