I hereby claim:
- I am halilim on github.
- I am halil (https://keybase.io/halil) on keybase.
- I have a public key ASCTFoy6Tqz9aQRrOCeOjMkn9M_xyoPNpU3g5_mbYMCpTgo
To claim this, I am signing this object:
| # Assumes gems: Chewy, Money and eu_central_bank | |
| class SearchForm | |
| include ActiveModel::Model | |
| DEFAULTS = { 'currency' => 'TRY' } | |
| attr_accessor :price_min, :price_max, :currency | |
| # ... |
| # spec/support/helpers.rb | |
| require 'support/helpers/i18n_helpers' | |
| # ... | |
| RSpec.configure do |config| | |
| config.include Features::I18nHelpers, type: :feature | |
| # ... | |
| end |
| # config/initializers/assets.rb | |
| # ... | |
| # The last two are for the file browser | |
| Rails.application.config.assets.precompile += %w(ckeditor/config ckeditor/application ckeditor/filebrowser/*) |
| CIPHER = { 'a' => 'n', 'b' => 'o', 'c' => 'p', 'd' => 'q', | |
| 'e' => 'r', 'f' => 's', 'g' => 't', 'h' => 'u', | |
| 'i' => 'v', 'j' => 'w', 'k' => 'x', 'l' => 'y', | |
| 'm' => 'z', 'n' => 'a', 'o' => 'b', 'p' => 'c', | |
| 'q' => 'd', 'r' => 'e', 's' => 'f', 't' => 'g', | |
| 'u' => 'h', 'v' => 'i', 'w' => 'j', 'x' => 'k', | |
| 'y' => 'l', 'z' => 'm' }.freeze | |
| REVERSE_CIPHER = CIPHER.invert.freeze |
I hereby claim:
To claim this, I am signing this object:
Prepare your RDS instance and [authorize access to it][1] (basically make it public).
Put your app in maintenance mode:
heroku maintenance:onSave the latest SQL dump of the DB:
| module Extendable # :nodoc: | |
| def self.extended(base) | |
| base.include InstanceMethods | |
| end | |
| module InstanceMethods # :nodoc: | |
| def hello | |
| puts 'hello from Extendable' | |
| super | |
| end |
| module TraceCalls | |
| def self.included(base) | |
| [base, base.singleton_class].each do |klass| | |
| klass.instance_methods(false).each do |existing_method| | |
| wrap(klass, existing_method) | |
| end | |
| end | |
| def base.method_added(method) | |
| TraceCalls.run_method_added(self, method, __method__) |
| require 'set' | |
| def find_uniq(ids) | |
| # O(n) space | |
| # uniqs = Set.new | |
| # ids.each do |id| | |
| # uniqs.delete(id) unless uniqs.add?(id) | |
| # end | |
| # uniqs.first | |
| # O(1) space |