-
Add the following packages to
pyproject.toml:minos-microservice-transactions
-
Update the
config.ymlfile as follows:- Replace
minos.aggregate.DatabaseTransactionRepositorybyminos.transactions.DatabaseTransactionRepository. - Replace
minos.aggregate.DatabaseEventRepositorybyminos.aggregate.DatabaseDeltaRepository. - Remove
minos.aggregate.TransactionServiceminos.aggregate.TransactionServicefrom theservicessection. - Add the following fields to the
aggregatesection as follows (replacingMyAggregatewith the corresponding class name):
- Replace
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const elements = document | |
| .getElementsByTagName("canvas"); | |
| for (let element of elements) { | |
| if (!element.id) { | |
| continue; | |
| } | |
| const image = element | |
| .toDataURL("image/png") |
- Add the following packages to
pyproject.toml:minos-database-aiopgminos-database-lmdb
- Add the following changes to
config.yml:- Add
clientto database-releated sections:- In
default,repository,snapshot,broker, etc. add:client: minos.plugins.aiopg.AiopgDatabaseClient - In
sagaorsaga.storageadd:client: minos.plugins.lmdb.LmdbDatabaseClient
- In
- Replace the following classes:
- Add
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| version: '3.9' | |
| x-microservice-environment: µservice-environment | |
| - MINOS_BROKER_QUEUE_HOST=postgres | |
| - MINOS_BROKER_HOST=kafka | |
| - MINOS_REPOSITORY_HOST=postgres | |
| - MINOS_SNAPSHOT_HOST=postgres | |
| - MINOS_DISCOVERY_HOST=discovery | |
| x-microservice-depends-on: µservice-depends-on | |
| - postgres | |
| - kafka |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| PREFIX='test_db' | |
| export PGPASSWORD=postgres | |
| export PGUSER=postgres | |
| export PGHOST=localhost | |
| export PGPORT=5432 | |
| TEST_DB_LIST=$(psql -l | awk '{ print $1 }' | grep '^[a-z]' | grep -v template | grep -v postgres) | |
| for TEST_DB in $TEST_DB_LIST ; do |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # If out of memory is raised: https://stackoverflow.com/a/43530569/3921457 | |
| do $$ | |
| declare tablename text; | |
| declare rolename text; | |
| begin | |
| for tablename in select datname FROM pg_database where datname like 'test_%' | |
| loop | |
| execute 'DROP DATABASE ' || tablename; | |
| end loop; |
As configured in my dotfiles.
start new:
tmux
start new with session name:
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| for x in *.zip ; do unzip -d . -o -u $x ; done |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # Screen resolution setup for ultra wide screen | |
| # URL: https://gist.github.com/garciparedes/f3b6d38ef7125a7b3c04d5e5ea970de4 | |
| sudo cvt 2560 1080 60 | |
| xrandr --newmode "2560x1080_60.00" 230.00 2560 2720 2992 3424 1080 1083 1093 1120 -hsync +vsync | |
| sudo xrandr --addmode HDMI-1-2 2560x1080_60.00 | |
| sudo xrandr --output HDMI-1-2 --mode 2560x1080_60.00 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Greatest common divisor of 1 or more numbers. | |
| from functools import reduce | |
| def gcd(*numbers): | |
| """ | |
| Return the greatest common divisor of 1 or more integers | |
| Examples | |
| -------- |
NewerOlder