Skip to content

Instantly share code, notes, and snippets.

View spierala's full-sized avatar

Florian Spier spierala

View GitHub Profile
import { CounterFeatureStore } from "./counter-feature-store";
const counterFs = new CounterFeatureStore();
counterFs.counter$.subscribe(count => console.log("count:", count));
counterFs.inc();
// OUTPUT: count: 11
// OUTPUT: count: 12
@spierala
spierala / vat.js
Created August 12, 2014 13:22
node.js vat calculator usable in the console like this: node vat.js [netto]
var util = require('util');
VatCalculator = function (netto) {
this.netto = netto;
};
VatCalculator.prototype.calculate = function(parts) {
var vat = 0.19 * this.netto;
var brutto = Number(this.netto) + Number(vat);
util.puts("vat: " + vat);