Skip to content

Instantly share code, notes, and snippets.

View dublx's full-sized avatar

Luis Faustino dublx

  • www.nearform.com
  • Ireland
View GitHub Profile
@dublx
dublx / retry.sh
Last active April 3, 2023 10:38
Bash - retry command N times
View retry.sh
#!/bin/bash
set -euo pipefail
function myFunction() {
myCommand
return $?
}
retry=0
maxRetries=5
@dublx
dublx / stream-abort.js
Created November 13, 2015 09:19
stream abort
View stream-abort.js
var stream = require('stream');
process.stdin.pipe(process.stdout);
function abort(){
process.stdin.unpipe();
process.stdin.end();
}
setTimeout(abort, 3000);
@dublx
dublx / gulpfile.js
Last active August 29, 2015 14:26
[nodejs:gulp] mocha watch
View gulpfile.js
//npm install --save-dev gulp gulp-mocha gulp-util
var gulp = require('gulp');
var mocha = require('gulp-mocha');
var gutil = require('gulp-util');
gulp.task('mocha', function() {
return gulp.src(['test/**/*.js'], { read: false })
.pipe(mocha({ reporter: 'spec' }))
.on('error', gutil.log);
});
@dublx
dublx / papers.md
Last active August 29, 2015 14:10 — forked from dominictarr/papers.md
View papers.md

(dominic: this list of papers was originally recommended to me by Brain Noguchi @bnoguchi, and was a great start to understanding distributed systems)

Here's a selection of papers that I think you would find helpful and interesting:

Time, Clocks, and the Ordering of Events in a Distributed System

The seminal paper about event ordering and concurrency. The important result is that events in a distributed system define a partially ordered set. The connection to what we're working on is fundamental, as this defines how to detect concurrent updates. Moreover, the chosen algorithm to turn the partially ordered set into a totally ordered set defines the conflict resolution algorithm.

http://research.microsoft.com/en-us/um/people/lamport/pubs/time-clocks.pdf