Skip to content

Instantly share code, notes, and snippets.

View MateuszNaKodach's full-sized avatar
🇵🇱
Blogging in Polish on NaKodach.PL

Mateusz Nowak MateuszNaKodach

🇵🇱
Blogging in Polish on NaKodach.PL
View GitHub Profile
@adymitruk
adymitruk / trello-cqrs-es.fish
Last active October 23, 2023 20:19
Trello in CQRS/ES in fish shell
#set up the dir structure if it doesn't exist
set t ~/.trello; mkdir -p $t
function if_exist # we don't want to litter our code with ifs if a read model or events are not there yet. Return /dev/nul for empty
if test -e $t/$argv[1]; echo $t/$argv[1]; else; echo /dev/null; end
end
function list # provide lists from our tab delimited entries with filtering and line item numbers to make choices
set list $argv[1]; set column_to_show $argv[2]; set filter $argv[3]; set count 1
cat (if_exist $list) | grep -e "$filter\$" | while read line
set -l line_items (string split \t $line)
echo $count\) $line_items[$column_to_show]
@graste
graste / eventstore.md
Last active May 3, 2021 16:49
EventStore installation and usage http://geteventstore.com
// adapted from https://github.com/gregoryyoung/m-r/blob/master/SimpleCQRS/CommandHandlers.cs
// actual code https://github.com/thinkbeforecoding/m-r/tree/FSharp/FsSimpleCQRS
module Commands =
//[<Abstract>]
type DeactivateInventoryItem =
{
InventoryItemId: Guid
OriginalVersion: int // version I'm acting on, for checking to make sure my change only fires if the data the change was based on is still unchanged