Skip to content

Instantly share code, notes, and snippets.

View smatsson's full-sized avatar

Stefan Matsson smatsson

View GitHub Profile
@smatsson
smatsson / ThrottledStream2.cs
Created January 23, 2020 15:38
ThrottledStream2
// source: https://stackoverflow.com/a/42133563
public class ThrottledStream2 : Stream
{
private readonly Stream parent;
private readonly int maxBytesPerSecond;
private readonly Stopwatch stopwatch;
private long processed;
public ThrottledStream2(Stream parent, int maxBytesPerSecond)
const xml2js = require('xml2js');
const fs = require('fs');
const xmlFileName = 'deployments.xml';
const environment = 'PROD';
const year = '2019';
xml2js.parseString(fs.readFileSync(xmlFileName), function (err, result) {
if (err) throw err;