Code, Strings, and Keys

    • About Thomas Powell
    • Account
    • It’s been [0] days since [program] last updated
    • Login
    • Password Reset
    • Pianist / Accompanist / Music Director Resume
    • Reading List 2025
    • Register
    • Running Gear – Shoes, Treadmill, and Bandages
    • Site Map
Illustration of a bird flying.
  • Easy Debug / Trace Ruby output like set -x in bash 10 lines of Ruby (or less)

    In writing some shell scripts in ruby, I decided that I needed to be able to debug (trace) the lines that were being executed. I even ran across a closed StackOverflow question looking for the same thing — a way to trace ruby like set -x in bash. A very naïve script to add tracing…

    July 4, 2021
  • Rails’ and Ruby’s Hash transform_values

    Rails: 4.2.1-5.2.3 and Ruby >= 2.5.5 have a transform_values method on Hash that allows you to pass a block to the method and transform the values of the key-value map in the hash based on the block contents. Essentially, it’s map but for the Hash values only, and with no weird Hash/array-element syntax. From the…

    June 29, 2021
  • NoMethodError undefined method `shared_examples_for’ for main:Object for bundle gem rspec

    undefined method shared_examples_for for main:Object in rspec for bundle gem generated rspec file.

    June 29, 2021
←Previous Page
1 … 35 36 37 38 39 … 310
Next Page→

Code, Strings, and Keys

Proudly powered by WordPress