Rails Testing I have often been told and red not to test the database. To avoid useless round trips and that my tests should be testing the code, not the database. That is the key to fast testing. But how fast exactly does this change? I took it upon myself to figure it out. I wanted to know the affects of slow vs fast testing and measure it.
Slow tests often come from round trip to the database. »
Ruby Shift vs Multiply Having a background in hardware development, I always assumed some operations were trivial and more efficient done some way rather than another.
One of those operations for example was the usage of shifting by 1 instead of multiplying by 2. The reason it would be more effective is due to the CPU complexity of multiplying by two as opposed to shifting bits which is equivalent to just selecting whatever is high on the clock cycle. »
Git Hooks Background Git is a very powerful tool with a lot of hidden features. Some of those features are left to the more experienced git users. One of those features is the usage the usage of hooks.
Hooks are, as their name suggest, a little piece of code that runs before or after some git action executed. Hooks default path is under your project directory at .git/hooks/<hook_name>.
You can read more about the hooks at the following web page »