Skip to content

Instantly share code, notes, and snippets.

Alexander Zeitler AlexZeitler

Block or report user

Report or block AlexZeitler

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@AlexZeitler
AlexZeitler / node-cluster-messaging.js
Created Apr 29, 2017 — forked from jpoehls/node-cluster-messaging.js
Simple message passing between cluster master and workers in Node.js
View node-cluster-messaging.js
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.
@AlexZeitler
AlexZeitler / gist:2c24a4d8ee10775f330447ff63bf19dc
Created Feb 12, 2017 — forked from digitaljhelms/gist:4287848
Git/GitHub branching standards & conventions
View gist:2c24a4d8ee10775f330447ff63bf19dc

Branching

Quick Legend

Instance Branch Description, Instructions, Notes
@AlexZeitler
AlexZeitler / vm-resize-hard-disk.md
Last active Feb 12, 2017 — forked from christopher-hopper/vm-resize-hard-disk.md
Resize a Hard Disk for a Virtual Machine provisioned using Vagrant from a Linux base box to run using VirutalBox.
View vm-resize-hard-disk.md

Resize a Hard Disk for a Virtual Machine

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.

Some assumptions

The following steps assume you've got a set-up like mine, where:

@AlexZeitler
AlexZeitler / cpu-bound.js
Created Oct 25, 2016 — forked from MikeBild/cpu-bound.js
Node.js - CPU bound operations with Rx
View cpu-bound.js
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))
@AlexZeitler
AlexZeitler / .gitconfig
Created Nov 28, 2015 — forked from samsalisbury/.gitconfig
Git diff and merge with p4merge (OSX)
View .gitconfig
[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
@AlexZeitler
AlexZeitler / README.md
Created Nov 13, 2015 — forked from jimothyGator/README.md
Nginx configuration for Mac OS X with Homebrew, using sites-enabled directory.
View README.md
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/
@AlexZeitler
AlexZeitler / gist:872b7ce1bf8c477e69b5
Created Oct 16, 2015 — forked from RubyTuesdayDONO/gist:5006455
logic revisions to pass test case
View gist:872b7ce1bf8c477e69b5
// 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;
@AlexZeitler
AlexZeitler / gist:076810d466fe44b5efe8
Last active Sep 19, 2015 — forked from six8/gist:1732686
Javascript dependency graph resolution
View gist:076810d466fe44b5efe8
// 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;
@AlexZeitler
AlexZeitler / gist:b8f0debac6bead7fda18
Last active Sep 18, 2015 — forked from benfoster/gist:4416655
A lightweight message bus using TPL DataFlow
View gist:b8f0debac6bead7fda18
using System;
using System.Collections.Concurrent;
using System.Threading;
using System.Threading.Tasks;
using System.Threading.Tasks.Dataflow;
namespace TDFDemo
{
class Program
{
@AlexZeitler
AlexZeitler / gist:4894f93c935c0f7c1495
Last active Sep 7, 2015 — forked from kagemusha/gist:5866759
Using Debugger with Grunt
View gist:4894f93c935c0f7c1495
version: grunt-cli v0.1.8
1. Install node-inspector globally (-g)
npm install -g node-inspector
2. Add debugger statements to your code
3. Run your grunt task in debug mode
You can’t perform that action at this time.