Skip to content

Instantly share code, notes, and snippets.

View giljr's full-sized avatar
💭
Full Stack Developer with a degree in Computer Engineering.

Gilberto Oliveira Jr giljr

💭
Full Stack Developer with a degree in Computer Engineering.
View GitHub Profile
@giljr
giljr / 6_tricks_tests_grid.md
Created October 25, 2025 16:10
Rails Conf 2013 The Magic Tricks of Testing by Sandi Metz https://youtu.be/URSWYvyc42M?si=dFF6lqd_dsJjoJeK

The Six Magic Tricks

by Sandi Metz

Origin Query (returns something) Command (changes something)
Incoming ① ✅ Assert return value ② ✅ Assert public side effect
To Self ③ 🚫 Ignore ④ 🚫 Ignore
Outgoing ⑤ 🚫 Ignore ⑥ ✅ Mock expectation
Quality Meaning
Thorough Fully prove object behavior
Stable Don’t break on refactors
Fast Run quickly and often
Few Only test what matters
Circus Performer Software Developer
Risks falling mid-act Risks breaking existing features
Trusts the net beneath Trusts the test suite beneath
Performs with confidence Deploys with confidence
@giljr
giljr / co_existing_apis.md
Last active October 25, 2025 13:26
🧭 Understanding URL Components How to Break Down and Identify Every Part of a Web Address - https://medium.com/jungletronics/understanding-url-components-7366f8a5d68b
Version Endpoint Controller Action
v1 /api/v1/rcad/processar Api::V1::RcadController processar
v2 /api/v2/rcad/processar Api::V2::RcadController processar

✅ Yes — they coexist, letting you upgrade or test new API versions without breaking the old one.

Component Example Description
Scheme (Protocol) http Defines how data is transferred (e.g., http, https, ftp)
Host localhost The domain or IP address where the resource lives
Port 3000 The communication port (often 80 for HTTP, 443 for HTTPS)
Path /api/v1/rcad/processar The exact location or route of the resource on the server
Query String ?user=gilberto&mode=fast Extra parameters sent to the server
Fragment #summary A reference to a section or element within the resource
Component Example Description
Scheme (Protocol) http Defines how data is transferred (e.g., http, https, ftp)
Host localhost The domain or IP address where the resource lives
Port 3000 The communication port (often 80 for HTTP, 443 for HTTPS)
Path /api/v1/rcad/processar The exact location or route of the resource on the server
Query String ?user=gilberto&mode=fast Extra parameters sent to the server
Fragment #summary A reference to a section or element within the resource
@giljr
giljr / stable_unstable.md
Created October 21, 2025 16:13
The Magic Tricks of Testing by Sandi Metz - Simplified Tutorial (https://youtu.be/URSWYvyc42M?si=AP4dW3on5uY1M5n7)
Concept Analogy Effect on code
Stable interface The plug socket standard Code keeps working
Changing implementation Wires inside the plug Code breaks often
@giljr
giljr / the_ggod_test.md
Created October 21, 2025 12:02
🪄 The Magic Tricks of Testing by Sandi Metz - Simplified Tutorial (https://youtu.be/URSWYvyc42M?si=xUgi3dEjVC1b2k4_)
Quality Meaning
Thorough Fully prove object behavior
Stable Don’t break on refactors
Fast Run quickly and often
Few Only test what matters
@giljr
giljr / test_message_grid.md
Created October 21, 2025 11:58
The Magic Tricks of Testing by Sandi Metz - Simplified Tutorial (https://youtu.be/URSWYvyc42M?si=xUgi3dEjVC1b2k4_)
Origin Query (returns something) Command (changes something)
Incoming
To Self
Outgoing
@giljr
giljr / regeneratin_stubs.md
Created October 19, 2025 15:05
How to regenerate all binstubs at once
Command Purpose
bundle binstubs --all Generate binstubs for all gems
bundle binstubs rspec-core Generate binstub only for RSpec
bundle exec spring binstub rails rspec Add Spring preload hooks
bin/spring stop Restart Spring after changes
bin/rspec Run tests fast in the correct environment