Skip to content

Instantly share code, notes, and snippets.

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

Thiago Ribeiro thiagovsk

🏠
Working from home
View GitHub Profile
vim.diagnostic.config({
virtual_text = false
})
-- Show line diagnostics automatically in hover window
vim.o.updatetime = 250
vim.cmd [[autocmd CursorHold,CursorHoldI * lua vim.diagnostic.open_float(nil, {focus=false})]]
@thiagovsk
thiagovsk / classes_2.rb
Last active March 16, 2022 21:33
using inheritance
class Formatter
def formatted_phone(phone)
phone.delete("^0-9")
end
end
class Payment < Formatter
def phone(phone)
formatted_phone(phone)
end
@thiagovsk
thiagovsk / classes.rb
Last active March 16, 2022 21:31
bad modules example
class Payment
def formatted_phone(phone)
phone.delete("^0-9")
end
end
class Contact
def formatted_phone(phone)
phone.gsub(/[^0-9]/, '')
end
module Formatter
def self.included base
base.extend ClassMethods
end
module ClassMethods
def class_method
"yahy"
end
end
require "active_support/concern"
module M
extend ActiveSupport::Concern
included do
has_many :things
scope :disabled, -> { where(disabled: true) }
after_commit :send_email
validates :email, length: { maximum: 255 }, email: true
@thiagovsk
thiagovsk / semantic-commit-messages.md
Created September 13, 2021 15:06 — forked from joshbuchea/semantic-commit-messages.md
Semantic Commit Messages

Semantic Commit Messages

See how a minor change to your commit message style can make you a better programmer.

Format: <type>(<scope>): <subject>

<scope> is optional

Example

@thiagovsk
thiagovsk / techtalk.txt
Last active April 26, 2021 18:46
git techtalk
- Primeira coisa a se fazer no git: Configurar o global user e global email
- Dia dia git, o que fazer quando ligo meu pc para trabalhar?
- Diferença entre merge e rebase? Pra que servem?
- https://blog.kitware.com/source/files/3_593278662_png
- https://www.atlassian.com/git/tutorials/merging-vs-rebasing/conceptual-overview
- Infinitos comandos git, logo um gitconfig pra facilitar as coisas.
- Comandos úteis (avançados...?)
- git branch -a
- git cherry-pick -x
- git commit -p
pra atualziar o changelog é
dch -m --team "New upstream release"
ou
gbp dch
para atualziar o upstream
gbp import-orig --pristine-tar --uscan
@thiagovsk
thiagovsk / gist:a433919d09717e1f19a5b79e2e4e1601
Last active October 14, 2019 14:59
importante event sourcing
We couldn’t find that file to show.
https://blog.trustbk.com/choosing-an-architecture-85750e1e5a03
https://github.com/zilverline/sequent
https://github.com/gregoryyoung/m-r
http://netcoders.com.br/implementando-o-design-pattern-repository-e-unit-of-work-com-entity-framework/
https://10consulting.com/2017/10/06/dealing-with-eventual-consistency/