This may a bit of niche problem to have, to pull changes from one clone of a repository to another clone, on the same machine. Why would I need to do this? The why At work, I have multiple of the same repository locally on my machine. One 'main' clone and multiple clones of the repository as submodules in another repository. I work on these local clones in different contexts, and I don't always…
I'm trying out Zellij after it announced non-colliding keybindings in version 0.41.0. Currently, I'm using iTerm and MacVim as two separate apps, but I'd like to try running everything in the terminal and switch to NeoVim. I never got into tmux , but I know there are plugins to have you smoothly switch between tmux and Vim panes like they are from the same application. I want this behavior in…
Let's do some metaprogramming in Ruby! This article assumes you have some familiarity with writing Ruby and are interested in learning how to use metaprogramming. This article is also available as a video recording of a talk . What's a DSL? Let's start with some definitions on what we're going to be looking at. The abbreviation DSL stands for Domain Specific Language . A DSL is a sub-language…
Let's calculate string length in Rust¹! How many characters there really are in a string and how much space these strings take up when displayed. ¹: This article may also apply to other languages. This article will only focus on strings with the Rust default UTF-8 encoding. There's an appendix for how it works in Ruby at the end of the article. I'm simplifying this content to keep the article…
Using RSpec there is some confusion about the differences between let , let! , and instance variables in specs. I'd like to focus on how instance variables work in RSpec in combination with before :context blocks, and in what kind of scenarios you should and should not use them. Why use instance variables? The advantage of declaring instance variables in before :context (or before :all ) blocks is…
Making a git commit can be as quick as git add --all && git commit -m "WIP" . The problem with this approach is that we didn't check what changes we committed. Who knows what got committed that shouldn't have. Usually we find out when it's too late. We want to see the Git changes before we commit. While working on an issue, I personally make a lot of changes that don't belong in the same commit.…