Gotcha: Request specYou may have faced this issue where { key: false } was treated as { “key”: “false” } when writing request specs in rails application development. Request params need to be passed as json along with content-type header in order for the Rails API to ca...1 min read·tenzinchemi.inDec 17, 2025
Ruby |= pipe assignment operatorirb(main):021> arr = [3] => [3] irb(main):022> arr |= [3] => [3] irb(main):023> arr |= [3, 2] => [3, 2] irb(main):024> arr |= [3, 2] => [3, 2]1 min read·tenzinchemi.inDec 11, 2025
Remove Nested module constant in rubyYou might have seen this solution. Object.send(:remove_const, :ExampleClass) But what if you want to remove namespaced classes in Ruby. You can use the same method, but instead of Object use the parent module where your class is nested. module App ...1 min read·tenzinchemi.inOct 18, 2023
Polygon's interior and exterior angleA polygon always has an exterior angle sum to 360 no matter the number of sides or their width. A triangle has an exterior angle sum equal to 360 A square has an exterior angle sum equal to 360 A pentagon has an exterior angle sum equal to 360 Quadri...1 min read·tenzinchemi.inSep 22, 2023
Parabolas wrapped in equationy = a(x-h)^2 + k If there's a parabola. You can find and tweak it with these parameters 'a' defines whether parabola is facing upward of downward 'h' defines horizontal position of the vertex of parabola. 'k' defines the narrowness of parabola. ...1 min read·tenzinchemi.inSep 20, 2023