Skip to content

Instantly share code, notes, and snippets.

View bruth's full-sized avatar

Byron Ruth bruth

View GitHub Profile
@francisrstokes
francisrstokes / StateDispatcher.js
Last active November 10, 2024 13:37
Redux without redux - sharing state and one way data flow using only standard react
import React from 'react';
export class StateDispatcher extends React.Component {
constructor(props) {
super(props);
this.state = props.state || {};
this._dispatch = this.dispatch.bind(this);
}
dispatch(action) {
@caleblloyd
caleblloyd / bench.sh
Last active February 8, 2023 01:23
NATS Memory Benchmark
#!/bin/bash
msgs_per_publisher="1 10 100 1000"
publishers="1 10 100 1000"
mem_limits="33554432 67108864 134217728 268435456"
seconds=10
timeout_seconds=13
passed=""
# set to 1 to enable jetstream
@renevo
renevo / keygenerator.md
Last active August 5, 2023 01:19
NATS Embeded JWT

Generating keys and jwts

This is basically how nsc creates an operator account + system account + system user really only need to keep track of the seeds, as they can be used to make public/private keys

JWT claims aren't that bad to make, just a lot of options in there basic operation is that:

  • you create an operator KP and claims
  • operator has a signing KP
  • you create an account KP and claims, and sign the account with the operator signing KP
  • account has a signing KP