Skip to content

Instantly share code, notes, and snippets.

View shayani's full-sized avatar
😀
Developing...

Fernando Shayani shayani

😀
Developing...
View GitHub Profile
@shayani
shayani / rspec_changed_files.sh
Last active March 29, 2024 18:44
Run RSpec only on changed/created `*_spec.rb` files from current agains target branch
#!/bin/bash
# Set default branch name
branch_name="${1:-staging}"
# Get changed files with grep for _spec.rb extension
changed_specs=$(git diff --name-only --diff-filter=d "$branch_name" | grep _spec.rb)
# Check if any changed specs found
if [[ -z "$changed_specs" ]]; then
@shayani
shayani / Fix_cedilha.md
Created July 24, 2023 03:33 — forked from thalesmaoa/Fix_cedilha.md
Fix cedilha in flatpak apps
flatpak override --user --env=GTK_IM_MODULE=cedilla net.xmind.XMind8
flatpak override --user --env=GTK_IM_MODULE=cedilla com.microsoft.Teams
@shayani
shayani / gist:81f8f85c16a1568ed663af4201dce9e5
Last active March 15, 2024 22:29
My basic linux profile setup
sudo apt install -y nala
# Packages
sudo nala install -y \
curl \
gcc \
g++ \
git \
gzip \
make \
@shayani
shayani / docker-compose.yml
Last active June 12, 2023 00:19
DEVEL docker-compose.yml
# To download the file run
# curl THIS_GIST_RAW_URL -o docker-compose.yml
# docker compose up
version: "3.9"
services:
postgres:
image: postgres:14
ports:
@shayani
shayani / refresh_trix.rb
Last active February 4, 2023 22:51
Fix missing images on Trix when upgrading from Rails 6.1 to 7.0
# Fix missing images on Trix when upgrading from Rails 6.1 to 7.0
# Source: https://discuss.rubyonrails.org/t/rails-6-1-7-gives-404-for-actiontext-attachments/80803
def refresh_trix(trix)
return unless trix.embeds.size.positive?
trix.body.fragment.find_all("action-text-attachment").each do |node|
embed = trix.embeds.find { |attachment| attachment.filename.to_s == node["filename"] && attachment.byte_size.to_s == node["filesize"] }