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 / 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
@giljr
giljr / rspec_binstub.md
Created October 19, 2025 14:57
🧩 What are binstubs?
Command Purpose
bundle exec spring binstub rspec Creates bin/rspec
bundle exec spring binstub rails Creates bin/rails
bin/rspec Run tests fast with Spring preloading
bin/spring stop Restart Spring if needed
@giljr
giljr / rspec_commads.md
Created October 19, 2025 14:49
What are the differences between : rails rspec rspec bin/rspec bundle exec rspec commands?
Command Loads Rails? Uses Gemfile Context? Typical Use Case
rails rspec ✅ Yes ✅ Yes (via Rails) Rails projects (environment-aware)
rspec ❌ No ❌ Maybe Simple Ruby scripts or global use
bin/rspec ✅ Yes (if Rails) ✅ Yes Team/CI consistency
bundle exec rspec ❌ No ✅ Yes Generic Bundler-safe execution
@giljr
giljr / up_down_migrations.md
Created October 17, 2025 22:00
07# Episode - RailsSeries - A Rails Blog In VS Code - Devise - How To Create A Blog in VS Code - Part V
Method Purpose
up Applies the migration (makes the changes: adds columns, sets defaults, etc.)
down Reverts the migration (undoes the changes: removes columns, resets defaults, etc.)
Feature Turbo Stream Direct Turbo Frame Button Turbo with Respond Turbo with AJAX
Server Interaction Turbo Stream Frame Targeted Respond Block AJAX Polling
Response Format Turbo Stream Frame Partial Turbo Stream Turbo Stream (AJAX)
Use Case Simple Updates Button Actions Multi-Format APIs Real-Time Updates
> user.signed_id
=> "eyJfcmFpbHMiOnsiZGF0YSI6MSwicHVyIjoidXNlciJ9fQ--4ef38fa58e98da155800151c24727be385e0c0bd628b492ff4813bd25862902e"
> user.to_global_id.to_s
=> "gid://ytm/User/1"
> user.signed_id(expires_in: 15.minutes)
=> "eyJfcmFpbHMiOnsiZGF0YSI6MSwiZXhwIjoiMjAyNS0wMS0xNVQxNjoyMToyMy4wNTRaIiwicHVyIjoidXNlciJ9fQ--6b20835c13452b287dbf5b89a3a477edaa2ea356827d26adea0749a3277b9c12"
> user.signed_id(expires_in: 15.minutes, purpose: "password_reset")
@giljr
giljr / session_manager.html.erb
Created January 14, 2025 15:18
A Cool Session Manager Rails Partial
<% if true %>
<ul class="navbar-nav ml-auto">
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
User Functionality
</a>
<div class="dropdown-menu dropdown-menu-right" aria-labelledby="navbarDropdown">
<%= link_to "Action", "#", class: "dropdown-item" %>
<div class="dropdown-divider"></div>
<%= button_to "Sign out", "#", method: :delete, class: "dropdown-item" %>
@giljr
giljr / docker_cmds
Last active September 29, 2024 21:53
Docker Commands
[Ubuntu Version]
release --version
lsb_release -a
[Install Docker]
sudo apt-get update
sudo apt-get install ca-certificates curl
sudo install -m 0755 -d /etc/apt/keyrings
PREFIX VERB URI patters Interface
new_user_session GET /users/sign_in Sign In (Login)
destroy_user_session DELETE /users/sign_out Sign Out
new_user_registration GET /users/sign_up Sign Up
edit_user_registration GET /users/edit Edit Account
/*Project:
47_UNIR_tls2561_Light_to_Digital_converter_v1.ino
Link: [TODO: LINK TO JUNGLETRONICS GOES HERE]
Objective:
This code demonstrates how to initialize and read data from the TSL2561
light sensor module over the I2C bus, providing insight into the ambient
light conditions in terms of Full Spectrum, Infrared, and Visible light.
It is designed to work with the TSL2561_I2CS I2C Mini Module GY2561.
It uses a chip TSL2561 which is a 16-bit digital I2C light sensor from