TCTenzin Chemiintenzinchemi.in·Dec 17, 2025 · 1 min readGotcha: 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...00
TCTenzin Chemiintenzinchemi.in·Dec 11, 2025 · 1 min readRuby |= 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]00
TCTenzin Chemiintenzinchemi.in·Oct 18, 2023 · 1 min readRemove 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 ...00
TCTenzin Chemiintenzinchemi.in·Sep 22, 2023 · 1 min readPolygon'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...00
TCTenzin Chemiintenzinchemi.in·Sep 20, 2023 · 1 min readParabolas 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. ...00