Cerebro App (Mac's alfred replacement)
| # config/initializers/delayed_job_config.rb | |
| Delayed::Worker.destroy_failed_jobs = true | |
| Delayed::Worker.sleep_delay = 5 | |
| Delayed::Worker.max_attempts = 25 | |
| Delayed::Worker.max_run_time = 4.hours | |
| Delayed::Worker.read_ahead = 5 | |
| Delayed::Worker.default_queue_name = 'default' | |
| Delayed::Worker.delay_jobs = true # or use "!Rails.env.test?" |
| # Configuration based on https://blog.gitbutler.com/how-git-core-devs-configure-git/ | |
| # Also, git graph idea from: https://coderwall.com/p/mlozoa | |
| [alias] | |
| graph = log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%aN>%Creset' | |
| [user] | |
| email = TODO@REPLACE-EMAIL | |
| name = Tiago Amaro | |
| [merge] | |
| tool = vscode |
Bower: alfred://customsearch/Bower%20Search%20%7Bquery%7D/bower/utf8/noplus/http://bower.io/search/?q={query}
Github: alfred://customsearch/Github/github/utf8/plus/https://github.com/search?q={query}
Mercado Livre: alfred://customsearch/Mercado%20Livre/mercado/utf8/noplus/http://lista.mercadolivre.com.br/{query}
RubyGems: alfred://customsearch/Ruby%20Gems/ruby/utf8/noplus/https://rubygems.org/search?query={query}
Sublime Package Control: alfred://customsearch/Sublime%20Package%20Control%20Search/subl/utf8/noplus/https://packagecontrol.io/search/{query}
| sphinx: bundle exec rake ts:run_in_background |
| # unicorn | |
| description "unicorn ruby app server" | |
| start on (local-filesystems and net-device-up IFACE=lo and runlevel [2345]) | |
| stop on runlevel [!2345] | |
| env WORKDIR=/data | |
| env PIDFILE=/data/tmp/pids/unicorn.pid | |
| env CFGFILE=/data/config/unicorn.rb |
This gist shows how you could use apartment with searchkick, including a rake task that reindex all models/tenants.
This gist is used in this blog post: http://tiagoamaro.com.br/2014/12/11/multi-tenancy-with-searchkick/
| # as described in http://guides.rubyonrails.org/association_basics.html#self-joins | |
| class User < ActiveRecord::Base | |
| has_and_belongs_to_many :friends, | |
| class_name: "User", | |
| foreign_key: "this_user_id", | |
| association_foreign_key: "other_user_id" | |
| end |
| GEM_NAME=nokogiri GEM_VERSION=1.6.6.2 ./globally_install_gems.sh & GEM_NAME=nokogiri GEM_VERSION=1.6.6.1 ./globally_install_gems.sh & GEM_NAME=nokogiri GEM_VERSION=1.6.5 ./globally_install_gems.sh & GEM_NAME=nokogiri GEM_VERSION=1.6.4.1 ./globally_install_gems.sh & GEM_NAME=nokogiri GEM_VERSION=1.6.4 ./globally_install_gems.sh & |
- pigments
- save-session
- sort-lines
- trailing-spaces