Here is how you can have some default git hooks auto installed with every new repo you clone. I use this to install
a pre-push
hook that adds a confirmation step to any push to main so that I don't accidentally push up any changes.
- set up git to use a templatedir
git config --global init.templatedir '~/.git_template'
mkdir -p ~/.git_template/hooks
- add in the
pre-push
hook code in.git_template/hooks/pre-push
A lot of the patterns covered in the articles below come up often in code reviews or when designing new features. There are also a couple of general dev tips & tricks articles sprinkled in there too.
Gourmet Service Objects http://brewhouse.io/blog/2014/04/30/gourmet-service-objects.html
Facade rules for controllers from Thoughtbot https://robots.thoughtbot.com/sandi-metz-rules-for-developers
Safe Operations For High Volume PostgreSQL
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
~/lookup_by 👻 bundle exec rake | |
/Users/sergio/.rubies/2.1.1/bin/ruby -I/Users/sergio/.gem/ruby/2.1.1/gems/rspec-core-3.0.0/lib:/Users/sergio/.gem/ruby/2.1.1/gems/rspec-support-3.0.0/lib -S /Users/sergio/.gem/ruby/2.1.1/gems/rspec-core-3.0.0/exe/rspec ./spec/association_spec.rb ./spec/caching/lru_spec.rb ./spec/lookup_by_spec.rb | |
/Users/sergio/lookup_by/spec/association_spec.rb:62:in `block (2 levels) in <top (required)>': undefined method `its' for RSpec::ExampleGroups::ActiveRecordBase::LookupFor:Class (NoMethodError) | |
from /Users/sergio/.gem/ruby/2.1.1/gems/rspec-core-3.0.0/lib/rspec/core/example_group.rb:331:in `module_exec' | |
from /Users/sergio/.gem/ruby/2.1.1/gems/rspec-core-3.0.0/lib/rspec/core/example_group.rb:331:in `subclass' | |
from /Users/sergio/.gem/ruby/2.1.1/gems/rspec-core-3.0.0/lib/rspec/core/example_group.rb:227:in `block in define_example_group_method' | |
from /Users/sergio/lookup_by/spec/association_spec.rb:11:in `block in <top (required)>' | |
from /Users/sergio/.gem/ruby/2.1.1/gems/rspec-core-3.0. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
~/play/rdiorb$ ./rdio-call --consumer-key <key> --consumer-secret <secret> search query=Morrissey types=artist count=1 -i | |
{"query"=>"Morrissey", "types"=>"artist", "count"=>"1"} | |
args: {"query"=>"Morrissey", "types"=>"artist", "count"=>"1"} | |
Called method: search({"query"=>"Morrissey", "types"=>"artist", "count"=>"1"}) : auth= | |
Post to url=/1/ method=search args={"query"=>"Morrissey", "types"=>"artist", "count"=>"1"} | |
{ | |
"status": "ok", | |
"result": { | |
"artist_count": 29, | |
"number_results": 29, |