Skip to content

Instantly share code, notes, and snippets.

@aricart
aricart / session.md
Last active January 10, 2020 21:40
npm release workflow
> npm dist-tag
latest: 1.3.0
next: 1.3.0
// start on feature - create a branch, edit code commit

// Time to release the 'pre release'
> npm version premajor
v2.0.0–0
@aricart
aricart / package.json
Last active May 23, 2019 16:35
stan queue debug
{
"name": "test",
"version": "1.0.0",
"description": "",
"main": "pub.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "ISC",
@aricart
aricart / node-nats-queue-worker-example.js
Last active February 18, 2020 14:30
queue worker node-nats-streaming
#!/usr/bin/env node
/*
* Copyright 2013-2019 The NATS Authors
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
@aricart
aricart / connectionsample.js
Last active November 4, 2018 18:19
sample nkey authentication with node-nats
const NATS = require('nats');
const nkeys = require('ts-nkeys');
// private key
var priv = nkeys.fromSeed("SUAFY3TGVXJBM5A4CLH7OE4P4N25KHLMF6BQLPJKMV5K6MIZAVVAS4JXAQ");
var ah = {};
ah.sign = function(data) {
return priv.sign(data);
};
@aricart
aricart / terraformerror.txt
Created June 27, 2018 20:13
terraform error
[5170:1]% terraform apply
An execution plan has been generated and is shown below.
Resource actions are indicated with the following symbols:
+ create
Terraform will perform the following actions:
+ aws_autoscaling_group.ngs-east-cluster
id: <computed>
@aricart
aricart / testconnection.js
Last active October 26, 2017 13:33
Test a node-nats connection
'use strict';
var NATS = require('../');
var nc = NATS.connect({maxReconnectAttempts: -1});
nc.on('error', function(e) {
console.error(e);
process.exit();
});
var nc = require('nats').connect();
nc.on('error', function(err) {
console.log(err);
});
nc.subscribe(">", function(msg, reply, subject, subID) {
console.log("msg: [" + msg + "] reply: [" + reply + "] subject: [" + subject + "] subID: [" + subID + "]");
});
nc.flush();
@aricart
aricart / server.conf
Last active March 1, 2017 17:53
node-nats publisher permission snippet
# Generated
authorization {
ADMIN = {
publish = ">"
subscribe = ">"
}
PUB = {
publish = "foo"
}
SUB = {