Skip to content

Instantly share code, notes, and snippets.

View alonsoir's full-sized avatar
πŸ‘‹
time to learn SCADA.

@alonso_isidoro alonsoir

πŸ‘‹
time to learn SCADA.
View GitHub Profile
@alonsoir
alonsoir / runMe.sh
Created June 24, 2020 10:59
script to run sample-spring-microservices-transactions
#/bin/bash
clear
cd gitProjects/sample-spring-microservices-transactions/
git pull
mvn clean install
rm *.log
# stoping possible running processes...
process_id_discovery=`ps -fu $USER | grep "discovery" | grep -v "grep" | awk '{print $2}'`
kill -9 $process_id_discovery
# Start discovery-server. It is available on port 8761.
@alonsoir
alonsoir / test.sh
Created June 24, 2020 11:01
Some curl commands to test sample-spring-microservices-transactions
# Add some test data to product-service and account-service. Maybe you have to addapt exact ports and ip. Check Eureka localhost:8761
# Some accounts... http://192.168.1.34:56059/actuator/info
curl -X POST http://192.168.1.34:56059/accounts -H "Content-Type: application/json" -d "{\"customerId\":1, \"balance\":0}"
curl -X POST http://192.168.1.34:56059/accounts -H "Content-Type: application/json" -d "{\"customerId\":2, \"balance\":10}"
curl -X POST http://192.168.1.34:56059/accounts -H "Content-Type: application/json" -d "{\"customerId\":3, \"balance\":100}"
# Some products... http://192.168.1.34:56082/actuator/info
curl -X POST http://192.168.1.34:56082/products -H "Content-Type: application/json" -d "{\"name\":\"Test\",\"count\":100, \"price\":1000}"
#/bin/bash
clear
git pull
mvn clean install
# Start discovery-server. It is available on port 8761.
java -jar discovery-server/target/discovery-server-1.0-SNAPSHOT.jar > discovery-server.log &
# Start RabbitMQ on Docker with command
docker rm -f rabbit
docker run -d --name rabbit -h rabbit -p 5672:5672 -p 15672:15672 rabbitmq:3-management
#/bin/bash
rm *.log
# stoping possible running processes...
process_id_discovery=`ps -fu $USER | grep "discovery" | grep -v "grep" | awk '{print $2}'`
kill -9 $process_id_discovery
# stoping possible running processes...
process_id_transaction_server=`ps -fu $USER | grep "transaction-server" | grep -v "grep" | awk '{print $2}'`
kill -9 $process_id_transaction_server
# stoping possible running processes...
process_id_account_service=`ps -fu $USER | grep "account-service" | grep -v "grep" | awk '{print $2}'`
@alonsoir
alonsoir / README-Template.md
Created July 13, 2020 19:35 — forked from PurpleBooth/README-Template.md
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

@alonsoir
alonsoir / pair_programming_roles
Created September 3, 2020 10:48 — forked from jordanpoulton/pair_programming_roles
Pair Programming Role Definitions - Driver:Navigator
Driver:
-Write the code according to the navigator's specification
-Listen intently to the navigators instructions
-Ask questions wherever there is a lack of clarity
-Offer alternative solutions if you disagree with the navigator
-Where there is disagreement, defer to the navigator. If their idea fails, get to failure quickly and move on
-Make sure code is clean
-Own the computer / keyboard
-Ignore larger issues and focus on the task at hand
-Trust the navigator - ultimately the navigator has the final say in what is written
import java.util.List;
import java.util.ArrayList;
import java.util.Scanner;
class EventSource {
public interface Observer {
void update(String event);
}
private final List<Observer> observers = new ArrayList<>();
package avro
import org.apache.avro.file.{DataFileReader, DataFileWriter}
import org.apache.avro.generic._
import org.apache.avro.io._
import org.apache.avro.specific.{SpecificDatumReader, SpecificDatumWriter}
import org.apache.avro.{Schema, SchemaBuilder}
import org.c02e.jpgpj._
import java.io._
@alonsoir
alonsoir / emojis-github.md
Created May 20, 2021 10:06 — forked from rxaviers/gist:7360908
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: πŸ˜„ :smile: πŸ˜† :laughing:
😊 :blush: πŸ˜ƒ :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
πŸ˜† :satisfied: 😁 :grin: πŸ˜‰ :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: πŸ˜€ :grinning:
πŸ˜— :kissing: πŸ˜™ :kissing_smiling_eyes: πŸ˜› :stuck_out_tongue:

Rough Notes about CQRS and ES

Once upon a time…

I once took notes (almost sentence by sentence with not much editing) about the architectural design concepts - Command and Query Responsibility Segregation (CQRS) and Event Sourcing (ES) - from a presentation of Greg Young and published it as a gist (with the times when a given sentence was heard).

I then found other summaries of the talk and the gist has since been growing up. See the revisions to know the changes and where they came from (aka the sources).

It seems inevitable to throw Domain Driven Design (DDD) in to the mix.