Use Git Grep to Replace Strings in Files in Your Git Repository 1 minutes | 92 wordsTL;DR On Linux: git grep -l 'original_text' | xargs sed -i 's/original_text/new_text/g' On Mac: git grep -l 'original_text' | xargs sed -i …
Renew DHCP Lease on Ubuntu VM After Moving Between Wireless Networks 1 minutes | 119 wordsTL;DR sudo dhclient -r [eth0] && sudo dhclient [eth0] I add that command as an alias to my ~/.bashrc file alias resetdhcp='sudo …
Double Exclmations !! In Ruby 1 minutes | 190 wordsToday I hit this in a Ruby example online: def role?(role) return !!self.roles.find_by_name(role.to_s.camelize) end Note the double …
Has And Belongs To Many Join Table Name Must Be In Alphabetical Order 1 minutes | 107 wordsTL;DR Read this from the Rails Guides Today I created an explicit join table between two models because each had has_and_belongs_to_many, as …
Create Rails Application in Current Directory 1 minutes | 112 wordsYes, I know the common way to create a Rails application is rails new and this will create a subfolder with your new Rails application …