Skip to content

Instantly share code, notes, and snippets.

View mariorez's full-sized avatar

Mario Rezende mariorez

View GitHub Profile
@rponte
rponte / a01_ExceptionHandlerInterceptor.kt
Last active January 26, 2023 11:21
Micronaut: Implementing a Micronaut AOP Interceptor for exception handling in gRPC endpoints
package br.com.zup.edu.shared.grpc
import io.grpc.BindableService
import io.grpc.stub.StreamObserver
import io.micronaut.aop.MethodInterceptor
import io.micronaut.aop.MethodInvocationContext
import org.slf4j.LoggerFactory
import javax.inject.Inject
import javax.inject.Singleton
@xpepper
xpepper / LondonVsChicago.md
Last active June 28, 2024 07:49
London vs Chicago, Comparative Case Study - Sandro Mancuso and Uncle Bob

My notes on the video series "London vs Chicago TDD styles" by Uncle Bob And Sandro Mancuso

The git repo of the kata is here: https://github.com/sandromancuso/cleancoders_openchat/

The "starting-point" branch is where both implementations began: https://github.com/sandromancuso/cleancoders_openchat/tree/starting-point

  • The 🇬🇧 "openchat-outside-in" branch captures the tomato by tomato history of the London approach.
  • The 🇺🇸 "openchat-unclebob" branch captures the tomato by tomato history of the Chicago approach.

What I like about Sandro's style 👍

@xpepper
xpepper / tdd-outside-in-mancuso-style.md
Last active March 19, 2024 20:36
Sandro Mancuso on Outside-In TDD

I'm putting here some of the things Sandro said in his 3-part session on Outside-In TDD (see the github repo here), and highlights some parts that are significant to me.

Sandro Mancuso on Outside-In TDD

TDD does not lead to a good design if you don't know what a good design looks like.

The way I code in this video is the way I normally code but not the way I normally teach.

Some of you will notice that I skip the traditional refactoring steps a few times and I do quite a lot of design up-front (or "just in time design" as I prefer to call it) without much feedback from my code.

@colophonemes
colophonemes / create_triggers
Last active February 17, 2024 15:15
Postgres TRIGGER to call NOTIFY with a JSON payload
CREATE TRIGGER person_notify AFTER INSERT OR UPDATE OR DELETE ON income
FOR EACH ROW EXECUTE PROCEDURE notify_trigger(
'id',
'email',
'username'
);
CREATE TRIGGER income_notify AFTER INSERT OR UPDATE OR DELETE ON income
FOR EACH ROW EXECUTE PROCEDURE notify_trigger(
'id',
@jakzal
jakzal / Doctrine.php
Last active September 14, 2020 13:19
Use Doctrine and Symfony Kernel in phpunit tests
<?php
declare(strict_types=1);
namespace SymfonyLive\Mastermind\Adapters\Database;
use Doctrine\Common\Persistence\ManagerRegistry;
use Doctrine\Common\Persistence\ObjectManager;
use Doctrine\ORM\Tools\SchemaTool;
use RuntimeException;
@stevehanson
stevehanson / Email.java
Created May 8, 2014 14:37
Mailgun Example - Java
package com.abc.model;
import java.util.List;
public class Email {
private String from;
private List<String> to;
private List<String> cc;
private List<String> bcc;
@SzymonPobiega
SzymonPobiega / gist:5220595
Last active April 25, 2024 17:19
DDD/CQRS/ES/Architecture videos

If you have two days to learn the very basics of modelling, Domain-Driven Design, CQRS and Event Sourcing, here's what you should do:

In the evenings read the [Domain-Driven Design Quickly Minibook]{http://www.infoq.com/minibooks/domain-driven-design-quickly}. During the day watch following great videos (in this order):

  1. Eric Evans' [What I've learned about DDD since the book]{http://www.infoq.com/presentations/ddd-eric-evans}
  2. Eric Evans' [Strategic Design - Responsibility Traps]{http://www.infoq.com/presentations/design-strategic-eric-evans}
  3. Udi Dahan's [Avoid a Failed SOA: Business & Autonomous Components to the Rescue]{http://www.infoq.com/presentations/SOA-Business-Autonomous-Components}
  4. Udi Dahan's [Command-Query Responsibility Segregation]{http://www.infoq.com/presentations/Command-Query-Responsibility-Segregation}
  5. Greg Young's [Unshackle Your Domain]{http://www.infoq.com/presentations/greg-young-unshackle-qcon08}
  6. Eric Evans' [Acknowledging CAP at the Root -- in the Domain Model]{ht