Separate gitconfig for work and play
Use conditional config to separate gitconfig for work and personal projects.
Pgcli - better command line interface for postgres
Today I came across pgcli. It is a database console for postgres with syntax highlighting
and more importantly autocompletion
!
Using ActiveModel::Dirty for tracking changes
ActiveRecord
comes with a mechanism to track changes to your model with ActiveModel::Dirty
. Lets put it to some use.
Chisel Refactoring
Last night I was watching Sandi Metz’s podcast on Bikeshed and one question in the QnA striked me.
Speedy array operations with Ruby 2.4
Ruby 2.4 has optimized Array#min
and Array#max
methods. Here are some benchmarks.
RSpec predicate matchers
Rspec has a pretty handy feature called predicate matchers to test predicate methods on your classes.
Sass mixins as functions
Sass mixins are pretty handy if you want to re-use same snippet of css at multiple places. But did you know they can act like functions as well?
Use Rails Enums carefully
ActiveRecord enums are really handy but they can be equally evil if not used properly.
Spying with Rspec
Spying is used to assert if a method has been called, here we will see how to use spies with Rspec.