I hereby claim:
- I am bencrouse on github.
- I am bencrouse (https://keybase.io/bencrouse) on keybase.
- I have a public key whose fingerprint is 0233 2681 1928 59F1 4206 1808 0580 67E2 ED88 1F84
To claim this, I am signing this object:
module ActiveShipping | |
class MyBuild < ActiveShipping::Fedex | |
def find_rates(*args) | |
results = super | |
# some code to customize the results | |
return results | |
end | |
end | |
end |
module Workarea | |
module Search | |
class Brands | |
include ProductDisplayRules | |
def all_results | |
buckets = Array.wrap(response.dig('aggregations', 'all_brands', 'buckets')) | |
buckets.map { |b| b['key'] } | |
end |
_key == '$in' ? new_val & old_val : old_val | new_val |
I hereby claim:
To claim this, I am signing this object:
Dragonfly[:weblinc].job(:small_thumb) do | |
encode :jpg, '-quality 85' | |
process :thumb, '60x' | |
process :optim | |
end | |
Dragonfly[:weblinc].job(:large_thumb) do | |
encode :jpg, '-quality 85' | |
process :thumb, '195x' | |
process :optim |
# starting point (line is too long) | |
def send_mail(source) | |
Mailer.deliver(to: 'bob@example.com', from: 'us@example.com', subject: 'Important message', body: source.text) | |
end | |
# bad (double indent) | |
def send_mail(source) | |
Mailer.deliver( | |
to: 'bob@example.com', | |
from: 'us@example.com', |
redis-cli keys 'query*' | awk '{ gsub("\"", "*", $1); print "\"" $1 "\"" }' | xargs redis-cli DEL |
1.9.3p194 :006 > Catalog::Product.last | |
=> #<Catalog::Product _id: PROD9990094, _type: nil, deleted_at: nil, version: 1, created_at: 2012-07-31 20:43:50 UTC, updated_at: 2012-07-31 20:43:50 UTC, slug: "test-product-211", display_starts_at: 2012-07-31 20:43:50 UTC, display_ends_at: nil, purchase_starts_at: 2012-07-31 20:43:50 UTC, purchase_ends_at: nil, site_id: 1, name: "Test Product 211", sale_starts_at: nil, sale_ends_at: nil, display_price_range: false, packaged_product_ids: []> | |
1.9.3p194 :007 > Catalog::Product.last.destroy | |
=> 0 | |
1.9.3p194 :008 > Catalog::Product.last | |
=> #<Catalog::Product _id: PROD9990094, _type: nil, deleted_at: 2012-08-02 16:46:50 UTC, version: 1, created_at: 2012-07-31 20:43:50 UTC, updated_at: 2012-07-31 20:43:50 UTC, slug: "test-product-211", display_starts_at: 2012-07-31 20:43:50 UTC, display_ends_at: nil, purchase_starts_at: 2012-07-31 20:43:50 UTC, purchase_ends_at: nil, site_id: 1, name: "Test Product 211", sale_starts_at: nil, sale_ends_at: nil, display_price_range: false, p |
{"ActionController::RoutingError"=>:not_found, | |
"AbstractController::ActionNotFound"=>:not_found, | |
"ActionController::MethodNotAllowed"=>:method_not_allowed, | |
"ActionController::NotImplemented"=>:not_implemented, | |
"ActionController::InvalidAuthenticityToken"=>:unprocessable_entity, | |
"ActiveRecord::RecordNotFound"=>:not_found, | |
"ActiveRecord::StaleObjectError"=>:conflict, | |
"ActiveRecord::RecordInvalid"=>:unprocessable_entity, | |
"ActiveRecord::RecordNotSaved"=>:unprocessable_entity | |
} |
data = { id: 'id', name: 'something' } | |
index = Tire::Index.new('index_name') | |
index.store(data) | |
index.refresh #(optionally) |