Skip to content

Instantly share code, notes, and snippets.

View gbrennon's full-sized avatar
🏠
Working from home

Glauber Brennon gbrennon

🏠
Working from home
  • São Paulo/SP - Brazil
  • 23:57 (UTC -03:00)
View GitHub Profile

Dependency Injection - Principles, Practices and Patterns

Book by Mark Seemann and Steven van Deursen

This document serves as a distilled summary of the book, tailored for a Node.js and TypeScript context.

Note

At the end of this summary, you will find section How We Do DI at Tactile which outlines our approach to Dependency Injection together with Clean Code and Unit Testing.

The book explores the core concepts of dependency injection, emphasising its role in promoting loose coupling, testability, and adherence to SOLID principles. It covers foundational DI patterns, anti-patterns, and advanced practices like Pure DI, lifetime management and Cross-Cutting Concerns with Aspect Oriented Programming.

--- mt codigo tb hehehe
local ok, copilot = pcall(require, "copilot")
if not ok then
vim.notify("Copilot not loaded", vim.log.levels.WARN)
return
end
copilot.setup({
suggestion = {
@gbrennon
gbrennon / Effective Scala Case Class Patterns.md
Created February 27, 2022 16:26 — forked from chaotic3quilibrium/Effective Scala Case Class Patterns.md
Article: Effective Scala Case Class Patterns - The guide I wished I had read years ago when starting my Scala journey

Effective Scala Case Class Patterns

Version: 2022.02.25a

Available As

#include <stdlib.h>
#include <stdio.h>
#include <time.h>
#include <pthread.h>
#define sensor_alto1 100;
#define sensor_alto2 150;
#define sensor_alto3 200;
int but;
void main()
{
char x = 0;
int i=0;
bit Play;
bit LastStatusPlay;
bit LastStatusClear;
@gbrennon
gbrennon / domain_events_example.py
Created February 26, 2021 01:13 — forked from objarni/domain event class in Python
Simplistic Domain Events Python
# coding: utf-8
import unittest
# Unit tests for kata 'domevent'
''' Synchronous domain events in pure Python.
#- triggering an event
#- registering a callback
#- triggering an event with 1 handler
#- triggering an event with 2 handlers
const BaseForm = Vue.extend({
template: `
<form>
<block name="header">
<h1>{{ title }}</h1>
</block>
<block name="content">Form inputs go here</block>
<block name="actions">
<button @click="saveRecord">Save</button>
<button @click="deleteRecord">Delete</button>
{
"completed": [
{
"id": "1562788901_f9750ff9-f3ae-4865-a9ea-1339d644f2f5",
"email": "suzana@projelengenharia.com.br",
"pending_at": 1562788901,
"last_seen": 1562789081,
"completed_at": 1562789081,
"success": true,
"reason": null,
@gbrennon
gbrennon / django_signals_slugify.py
Created August 1, 2018 14:22 — forked from matheusho/django_signals_slugify.py
Django : Generate unique slug
# import signals and slugify
from django.db.models import signals
from django.template.defaultfilters import slugify
# function for use in pre_save
def yourmodel_pre_save(signal, instance, sender, **kwargs):
if not instance.slug:
slug = slugify(instance.attribute) # change the attibute to the field that would be used as a slug
new_slug = slug
Traceback (most recent call last):
File "services.py", line 11, in <module>
url,
File "/Users/gbrennon/Documents/Projects/Sercortes/sercortes/env/lib/python3.6/site-packages/zeep/client.py", line 62, in __init__
wsdl, self.transport, settings=self.settings)
File "/Users/gbrennon/Documents/Projects/Sercortes/sercortes/env/lib/python3.6/site-packages/zeep/wsdl/wsdl.py", line 84, in __init__
root_definitions = Definition(self, document, self.location)
File "/Users/gbrennon/Documents/Projects/Sercortes/sercortes/env/lib/python3.6/site-packages/zeep/wsdl/wsdl.py", line 184, in __init__
self.messages = self.parse_messages(doc)
File "/Users/gbrennon/Documents/Projects/Sercortes/sercortes/env/lib/python3.6/site-packages/zeep/wsdl/wsdl.py", line 336, in parse_messages