Skip to content

Instantly share code, notes, and snippets.

View gabrieljoelc's full-sized avatar

Gabriel Chaney gabrieljoelc

View GitHub Profile

Applied distributed system communication stuff

Scenario

Frontend API (FA):

  1. User adds wallet
  2. User KYC verifies
  3. User changes wallet
  4. User changes wallet
@gabrieljoelc
gabrieljoelc / notes.md
Created August 4, 2021 16:02
"A Complete Guide to useEffect" notes

These notes are based the excellent A Complete Guid to useEffect.

Quote:

Does count somehow “watch” changes to our state and update automatically? That might be a useful first intuition when you learn React but it’s not an accurate mental model.

In this example, count is just a number. It’s not a magic “data binding”, a “watcher”, a “proxy”, or anything else. It’s a good old number

@gabrieljoelc
gabrieljoelc / postman-sas-script.js
Last active November 24, 2020 21:47
Pre-request Postman script for sending Azure Service Bus REST requests using a SAS key
GistID: eedf956842966c41d47322f5b9e2a121
// Pre-request Postman script for sending Azure Service Bus REST requests using a SAS key
// https://docs.microsoft.com/en-us/rest/api/eventhub/Generate-SAS-token?redirectedfrom=MSDN#nodejs
// also https://gist.github.com/DinoChiesa/75796b27828cf8e15c91
const sasKey = postman.getEnvironmentVariable("SASKey");
const sasKeyName = postman.getEnvironmentVariable("SASKeyName");
const sbSubDomain = postman.getEnvironmentVariable("REST_SUBDOMAIN");
@gabrieljoelc
gabrieljoelc / gist:56b97504fe25525aba432ca0b9bbd93b
Created July 10, 2020 06:09
pass contents of .env file to a command
# requires values with whitespace to be surrounded with double quotes
env -S "`cat .env`" dotnet run
GistID: 4060cc90d31c57d8d77c8b011e2420af
1. Developer makes change to tf config
1. Commits to pr branch
1. PR branch build runs tf _plan_
1. Manual pr "check" for devops to review plan in CI
1. Devops person approves
1. PR is merged into develop/master
1. develop/master build pipeline runs _apply_ after tests pass
@gabrieljoelc
gabrieljoelc / heroku-config-set.sh
Last active June 20, 2020 21:16
Set Heroku config from .env file
# assuming .env file is in working directory and looks like (must have no whitspace expect for newlines or within quotes)
# REACT_APP_API_URL=https://myapi.io
# REACT_APP_AUTH_TOKEN=123
# see https://stackoverflow.com/a/4229346/34315
for line in `cat .env`; do echo "$line"; done
  • Data distribution vs. pub/sub

    • Data distribution is physical architecture
    • Pub/sub is more focused on logical architecture
  • Udi's "service" is a logical entity vs. component physical entity (a piece of code running in one or more hosts)

  • Preferred interaction

  • Avoid crossing network boundaries within service boundaries

  • Service - technical authority for a business capability

  • Data distribution from a database to a frontend is likely within the same logical service boundary

  • For pub/sub communicating between differing business capabilities usually doesn't care about low latency

GistID: f6f0f97692f2dee4590c0403865b29cb

Dapr on Azure

Serverless

I want to replace Azure Functions with custom auto-scaling / consumption utilization using Dapr. I'm going to use this sample to get started.

Pre-requisite steps:

GistID: cba6f001e9a8e35b9a816eab86debfa1
# Requirements
- Foldable
- Upright
- Under $200
# Nice-to-have