Skip to content

Instantly share code, notes, and snippets.

View bruth's full-sized avatar

Byron Ruth bruth

View GitHub Profile
@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
@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
@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) {
@PurpleBooth
PurpleBooth / README-Template.md
Last active December 12, 2024 16:36
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

@CMCDragonkai
CMCDragonkai / http_streaming.md
Last active December 9, 2024 18:12
HTTP Streaming (or Chunked vs Store & Forward)

HTTP Streaming (or Chunked vs Store & Forward)

The standard way of understanding the HTTP protocol is via the request reply pattern. Each HTTP transaction consists of a finitely bounded HTTP request and a finitely bounded HTTP response.

However it's also possible for both parts of an HTTP 1.1 transaction to stream their possibly infinitely bounded data. The advantages is that the sender can send data that is beyond the sender's memory limit, and the receiver can act on

@pmdarrow
pmdarrow / iterm-launcher.js
Last active September 14, 2017 20:52
Launch iTerm 2 with a predefined tab & split configuration using Apple's "Javascript for Automation"
/**
* AppleScript to launch iterm2 terminals/tabs with configurable:
* ~ Name <name>
* ~ List of commands <cmds>
* ~ Split behavior horizontal(h) or vertical(v) <split> :: (h, v)
*
* Run from terminal with `osascript iterm-launcher.js`.
* Don't unfocus with the mouse/keyboard while executing the script.
*
* JS port of https://github.com/luismartingil/scripts/blob/master/iterm_launcher02.applescript
@brianbianco
brianbianco / gist:cb8a9f73a39ed1f42934
Created October 13, 2014 20:36
Shared volumes OS X / Docker
  $ cd ~/.boot2docker
  $ curl http://static.dockerfiles.io/boot2docker-v1.2.0-virtualbox-guest-additions-v4.3.14.iso > boot2docker.iso
  $ boot2docker init
  $ VBoxManage sharedfolder add boot2docker-vm -name home -hostpath /Users
  $ boot2docker up
 
  $ boot2docker ssh "sudo modprobe vboxsf && mkdir -v -p /Users && sudo mount -v -t vboxsf  -o uid=0,gid=0 home /Users"
@LeCoupa
LeCoupa / bash-cheatsheet.sh
Last active December 13, 2024 21:03
Bash CheatSheet for UNIX Systems --> UPDATED VERSION --> https://github.com/LeCoupa/awesome-cheatsheets
#!/bin/bash
#####################################################
# Name: Bash CheatSheet for Mac OSX
#
# A little overlook of the Bash basics
#
# Usage:
#
# Author: J. Le Coupanec
# Date: 2014/11/04
@ebidel
ebidel / Web Components Resources.md
Last active October 12, 2024 17:10
List of resources related to Web Components
@deiu
deiu / git-delete-history.sh
Last active September 10, 2018 07:57
Script to permanently remove files/folders from your Git history.
#!/bin/bash
# Script to permanently remove files/folders from your git history. To use
# it, cd to your repository's root and then run the script with a list of paths
# you want to delete, e.g., git-delete-history path1 path2
set -o errexit
if [ $# -eq 0 ]; then
echo "Usage: $0 file1 file2"
echo " or: $0 path1 path2"