I hereby claim:
- I am aishek on github.
- I am aishek (https://keybase.io/aishek) on keybase.
- I have a public key ASCG0kHVMkr4kkywJkqlkbMTUTz4E9SbOnZa3inOR6NMKAo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
| middle = ->(array) { array[array.size / 2] } | |
| def plural(string, plural_ending) | |
| return string if string.end_with?(plural_ending) | |
| "#{string}#{plural_ending}" | |
| end | |
| files = `ls -a`.split("\n") |
| def deliver_order_details_email_async(order) | |
| # Было | |
| # | |
| # if order.long? | |
| # Order::PickUpEmailWorker.perform_async(order.id) | |
| # else | |
| # Order::PickUpAndDropOffEmailWorker.perform_async(order.id) | |
| # end | |
| # Стало |
| function sendPickUpEmailAsync(order) { | |
| if (order.fromOffice()) return; | |
| if (order.isLong()) { | |
| sendPickUpEmailAsync(order) | |
| } | |
| else { | |
| sendPickUpAndDropOffEmailAsync(order) | |
| } | |
| } |
| def send_pick_up_email_async(order) | |
| return if order.from_office? | |
| if order.long? | |
| Order::PickUpEmailWorker.perform_async(order.id) | |
| else | |
| Order::PickUpAndDropOffEmailWorker.perform_async(order.id) | |
| end | |
| end |
| def send_pick_up_email_async(order) | |
| unless order.from_office? | |
| if order.long? | |
| Order::PickUpEmailWorker.perform_async(order.id) | |
| else | |
| Order::PickUpAndDropOffEmailWorker.perform_async(order.id) | |
| end | |
| end | |
| end |
| # config/environments/production.rb | |
| MyRails4::Application.configure do | |
| # ... | |
| config.action_dispatch.default_headers = { | |
| 'X-XSS-Protection' => '1; mode=block', | |
| 'X-Content-Type-Options' => 'nosniff' | |
| } | |
| # ... | |
| end |
| # config/application.rb | |
| # ... | |
| module Example | |
| class Application < Rails::Application | |
| # ... | |
| config.action_controller.default_url_options = { :trailing_slash => true } | |
| config.action_mailer.default_url_options = { :trailing_slash => true } | |
| end |
| # app/controllers/api/v1/games_api.rb | |
| class Api::V1::GamesAPI < Api::V1::BaseAPI | |
| use ::Api::V1::Logger | |
| # ... | |
| end |