Controlled Bursts | TDD | TCR | 100% Coverage | Emergent Design | Extreme Ownership
Red → Green → TCR → Refactor → TCR → Done
TCR: test && commit || revert
- Pass → commit → continue
| defmodule UniqueUsername do | |
| @behaviour Commanded.Middleware | |
| alias Commanded.Middleware.Pipeline | |
| def before_dispatch(%Pipeline{command: %RegisterUser{} = command} = pipeline) do | |
| %RegisterUser{username: username} = command | |
| case Repo.insert(%Username{username: username}) do | |
| {:ok, _} -> |
Are you using Blue Heron on your Nerves device? Are you having trouble figuring out why things aren't working? Fear not! The HCI packet log may be able to help you. And this gist will let you know how to read it with Wireshark.
The Blue Heron readme states:
This project includes a Logger backend to dump PKTLOG format. This is the same format that Android, IOS, btstack, hcidump, and bluez use.
By default, Blue Heron will write this PKGLOG to /tmp/hcidump.pklg on your Nerves device.
You can transfer it to your computer with scp (scp nerves.local:/tmp/hcidump.pklg . should copy it to your local directory).
This code is extracted from one of my private projects as an example of how to implement encryption of PII in event streams using two keys: a master key for each "data subject" that is stored in Vault and never transported to the systems that process the PII, and a key unique to each event that is stored (itself encrypted) with the event.
To be clear, the key that is stored with the data is encrypted by another key that is not stored with the data. The idea is that each "data subject" has an encryption key that is stored in Vault (external). When you encrypt data, the library will:
| [Unit] | |
| Description=Connecting MySQL Client from Compute Engine using the Cloud SQL Proxy | |
| Documentation=https://cloud.google.com/sql/docs/mysql/connect-compute-engine | |
| Requires=networking.service | |
| After=networking.service | |
| [Service] | |
| WorkingDirectory=/usr/local/bin | |
| ExecStart=/usr/local/bin/cloud_sql_proxy -dir=/var/run/cloud-sql-proxy -instances=<INSTANCE_CONNECTION_NAME>=tcp:3306 | |
| Restart=always |
Example read model projections using Commanded Ecto projections where Elixir's Registry is used for pub/sub notifications of read model updates.
This alleviates the problem of async read model updates.
The command dispatcher can wait until the read model has been updated to the exact aggregate version (as returned by the dispatch command):
with {:ok, version} <- Router.dispatch(register_user, include_aggregate_version: true) do
| # | |
| # Build configuration for Circle CI | |
| # | |
| # See this thread for speeding up and caching directories: https://discuss.circleci.com/t/installing-android-build-tools-23-0-2/924 | |
| # | |
| general: | |
| artifacts: | |
| - /home/ubuntu/AndroidCI/app/build/outputs/apk/ |
| public class Pager<I, O> { | |
| private static final Observable FINISH_SEQUENCE = Observable.never(); | |
| private PublishSubject<Observable<I>> pages; | |
| private Observable<I> nextPage = finish(); | |
| private Subscription subscription = Subscriptions.empty(); | |
| private final PagingFunction<I> pagingFunction; | |
| private final Func1<I, O> pageTransformer; |
| # | |
| # A: | |
| # pubsub = PgPubSub.new('channelname') | |
| # pubsub.subscribe do |data| | |
| # puts "data: #{data} is coming!" | |
| # end | |
| # | |
| # B: | |
| # pubsub = PgPubSub.new('channelname') | |
| # pubsub.publish("hello world") |