Skip to content

Instantly share code, notes, and snippets.

View abacha's full-sized avatar

Adriano Bacha abacha

  • São Paulo, SP
  • 02:27 (UTC -03:00)
View GitHub Profile
@abacha
abacha / uat_no_rollback.rb
Last active April 14, 2026 18:56
Review App UAT Script NO ROLLBACK
puts "⚙️ Setting up test data para bater valendo no SMTP..."
active_user = User.where(email: "[email protected]").first || User.last
inactive_user = User.where(email: "[email protected]").first || User.where.not(id: active_user.id).last
organization = active_user.organizations.first || Organization.last
# Force the 'last_activity' dates
active_user.update_column(:last_activity, 2.days.ago)
inactive_user.update_column(:last_activity, 40.days.ago)
@abacha
abacha / review_app_tester.rb
Last active April 14, 2026 17:57
Review App UAT Script: Hubstaff Extra Emails (HUB-14055)
ActiveRecord::Base.transaction do
puts "⚙️ Setting up test data for Review App..."
# Find an organization with at least one manager and two shifts
active_shift = AttendanceShift.where.not(user_id: nil).last
inactive_shift = AttendanceShift.where.not(id: active_shift&.id, user_id: nil).last
active_break = WorkBreak.where.not(user_id: nil).last
inactive_break = WorkBreak.where.not(id: active_break&.id, user_id: nil).last
@abacha
abacha / hubstaff_uat_emails.md
Created April 14, 2026 14:29
UAT Script: Hubstaff Extra Emails Suppression (HUB-14055)

How to trigger:

Part 1: Removed Emails (Should never send)

  1. AchievementMailer.earned_achievements
  • Trigger the achievement email for a user via rails console:
user = User.last
achievement = Achievement.last
AchievementMailer.earned_achievements(user.id, achievement.id).deliver_now
@abacha
abacha / Relatorio_Limpeza_Memorias_V2.md
Created April 12, 2026 22:51
Proposta de Limpeza de Memórias Recall V2 (Pós-Reprocessamento)

Proposta de Limpeza de Memórias (Recall) V2 - 2026-04-12

Após o reprocessamento com os novos prompts de ingestão, a fila de candidatos reduziu drasticamente de 1.145 para 203 itens. O Nexus está muito mais cirúrgico, mas ainda há redundâncias entre perfis (ex: memórias duplicadas entre "Adriano Bacha" e um perfil genérico "Adriano").

👤 Adriano Bacha (Dri) / Adriano (Perfil duplicado)

  • Aprovar (Perfil/Facts):
    • Uso do app Hevy para treinos.
    • Participação na São Silvestre (31/12) e prova de 10km (14/12).
    • Mudança para treino híbrido (força/potência) para judô/corrida.
  • Hábito de levar café para o Diego matinalmente.
@abacha
abacha / Relatorio_Limpeza_Memorias.md
Created April 12, 2026 22:07
Proposta de Limpeza de Memórias Recall (Agrupado por Pessoas)

Proposta de Limpeza de Memórias (Recall) - 2026-04-12

Identifiquei uma redundância massiva e dados irrelevantes na fila de candidatos (1.145 itens). Abaixo está a proposta de agrupamento e o que pode ser limpo.

👤 Adriano Bacha (Dri)

  • Aprovar (Perfil/Facts):
    • Mudança do treino para 06:15 da manhã.
    • Uso do Hevy para cargas e Hevy/ChatGPT para análise.
    • Restrição no ombro e foco em quadril para corrida.
  • Frequenta Dymanus e Smart Fit Bartolomeu Mitre (RJ).
gitlab_rails['ldap_servers'] = YAML.load <<-'EOS' #remember to close this block with 'EOS' below
main: 'main' is the GitLab 'provider ID' of this LDAP server
label: 'LDAP'
host: '_your_ldap_server'
port: 389
uid: 'sAMAccountName'
method: 'plain' "tls" or "ssl" or "plain"
bind_dn: '_the_full_dn_of_the_user_you_will_bind_with'
password: '_the_password_of_the_bind_user'
active_directory: true
{"success":true,"result":[{"vl_pu_gerencial":0,"taxa_pre_gerencial":0,"taxa_pre":14.58111000,"pc_indice":100,"issuer":"BANCO INDUSVAL S.A","vl_bruto_gerencial":0,"vl_pu":1.1058570000000000,"vl_aplic_lic":100000,"nm_client":"EDIVALDO FERREIRA CAMPOS","qt_paper":100000,"dt_aplic":20150714,"id_operacao_crk":1050808,"dt_reference":20160322,"vl_bruto":110585.70000000,"nm_inx":"PRÉ","title_class":"CDB PRE - P","dt_vencto":20170704,"cpf_cnpj":"8035300482","pc_indice_gerencial":0},{"vl_pu_gerencial":0,"taxa_pre_gerencial":0,"taxa_pre":14.58111000,"pc_indice":100,"issuer":"BANCO INDUSVAL S.A","vl_bruto_gerencial":0,"vl_pu":1.1054390000000000,"vl_aplic_lic":100000,"nm_client":"EDIVALDO FERREIRA CAMPOS","qt_paper":100000,"dt_aplic":20150714,"id_operacao_crk":1050808,"dt_reference":20160321,"vl_bruto":110543.90000000,"nm_inx":"PRÉ","title_class":"CDB PRE - P","dt_vencto":20170704,"cpf_cnpj":"8035300482","pc_indice_gerencial":0},{"vl_pu_gerencial":0,"taxa_pre_gerencial":0,"taxa_pre":14.58111000,"pc_indice":100,"issuer
346161
366192
365230
364775
365998
366089
338481
324962
324841
357250
SINACOR - CC - ok 24/02
ARQUIVO - FIDC - ok 24/02
grouped = {
CPF_Cliente1 => {
8468 => {
"02/2015" => [100,50],
"06/2015" => [1450,21]
12:00:00,563 SEVERE [br.bip.com.sinacor.dao.EaoTsccligerBean] (http-spodcapp0022/172.16.5.28:8080-14) null: javax.persistence.PersistenceException:
Exception Description: Error binding to externally managed transaction
Internal Exception: javax.transaction.RollbackException: ARJUNA016083: Can't register synchronization because the transaction is in aborted state
at org.eclipse.persistence.internal.jpa.transaction.JTATransactionWrapper.registerIfRequired(JTATransactionWrapper.java:145) [eclipselink-2.5.2.jar:2.5.2.v20140319-9ad6abd]
at org.eclipse.persistence.internal.jpa.EntityManagerImpl.setJTATransactionWrapper(EntityManagerImpl.java:2153) [eclipselink-2.5.2.jar:2.5.2.v20140319-9ad6abd]
at org.eclipse.persistence.internal.jpa.EntityManagerImpl.detectTransactionWrapper(EntityManagerImpl.java:878) [eclipselink-2.5.2.jar:2.5.2.v20140319-9ad6abd]
at org.eclipse.persistence.internal.jpa.EntityManagerImpl.initialize(EntityManagerImpl.java:401) [eclipselink-2.5.2.jar:2.5.2.v20140319