This gist accompanies a workshop titled "How to instrument your Rails app with OpenTelemetry" that was held at RailsConf 2025 in Philadelphia on July 9, 2025.
| ### | |
| # SSH keys setup with Apple keychain | |
| ### | |
| if [ -z "$SSH_AUTH_SOCK" ] && [ -z "$SSH_AGENT_PID" ]; then | |
| # If no SSH Agent is running, start one and load keys from Apple keychain | |
| eval `ssh-agent -s` &> /dev/null | |
| ssh-add --apple-load-keychain &> /dev/null | |
| else | |
| if [ -z "$(ssh-add -l | grep SHA256)" ]; then | |
| # If agent is running but has no keys, load keys from Apple keychain |
| ruby '2.7.1' | |
| gem 'rails', github: 'rails/rails' | |
| gem 'tzinfo-data', '>= 1.2016.7' # Don't rely on OSX/Linux timezone data | |
| # Action Text | |
| gem 'actiontext', github: 'basecamp/actiontext', ref: 'okra' | |
| gem 'okra', github: 'basecamp/okra' | |
| # Drivers |
| I was drawn to programming, science, technology and science fiction | |
| ever since I was a little kid. I can't say it's because I wanted to | |
| make the world a better place. Not really. I was simply drawn to it | |
| because I was drawn to it. Writing programs was fun. Figuring out how | |
| nature works was fascinating. Science fiction felt like a grand | |
| adventure. | |
| Then I started a software company and poured every ounce of energy | |
| into it. It failed. That hurt, but that part is ok. I made a lot of | |
| mistakes and learned from them. This experience made me much, much |
| /* | |
| * MIT License | |
| * | |
| * Copyright (c) 2023-2024 Fabio Lima | |
| * | |
| * Permission is hereby granted, free of charge, to any person obtaining a copy | |
| * of this software and associated documentation files (the "Software"), to deal | |
| * in the Software without restriction, including without limitation the rights | |
| * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
| * copies of the Software, and to permit persons to whom the Software is |
Have you ever tried to merge two branches only to end up in conflict hell? You fix a bunch of conflicts only to run git merge --continue and be presented with the same conflicts. Repeat this process and after a few iterations you give up because it just isn't worth the pain and effort.
Would you be surprised to know that there is a git feature specifically for this problem? It's called rerere and I'm going to enrich your life with it now. (I'm going to talk specifically about merging but I think it also helps rebasing)
rerere stands for Reuse Recorded Resolution. The TL;DR version is you ask git to remember how you've resolved hunks in the past, and if the same one comes up for a file in future just redo what you did last time.
To enable this feature just run this lovely command git config --global rerere.enabled true. You can also turn it on by creating this directory in your projects .git/rr-cache, although the global setting is much clearer.
I'll try to take you through an example of how th
One way to do this is to use bundler to scaffold our gem:
bundler gem my_gem
I prefer to put tasks meant to manage the gem itself in lib/tasks, and tasks the gem is meant to provide to gem users in lib/my_gem/tasks.
| import Foundation | |
| import SceneKit | |
| public enum BinarySTLParser { | |
| public enum STLError: Error { | |
| case fileTooSmall(size: Int) | |
| case unexpectedFileSize(expected: Int, actual: Int) | |
| case triangleCountMismatch(diff: Int) | |
| } | |