%w[a b c].reduce({}) { |accum, char|
accum[char.to_sym] = char * 3; accum
}
# {:a=>"aaa", :b=>"bbb", :c=>"ccc"}
(into {}
(map (fn [char] [(keyword char) (apply str (repeat 3 char))])
shared_buffers = 3GB # 30% of total system RAM | |
work_mem = 5MB | |
maintenance_work_mem = 64MB | |
fsync = off | |
synchronous_commit = off | |
full_page_writes = off | |
checkpoint_segments = 100 | |
checkpoint_timeout = 45min | |
effective_cache_size = 6GB # twice shared_buffers |
.target-fade { | |
-webkit-animation: target-fade 10s 1; | |
-moz-animation: target-fade 10s 1; | |
} | |
@-webkit-keyframes target-fade { | |
0% { background-color: rgba(80, 173, 118, .1); } | |
100% { background-color: rgba(80, 173, 118, 0); } | |
} |
class CatsController < ApplicationController | |
def index | |
render json: Cat.all, simple: params[:simple], status: :ok | |
end | |
end | |
class CatSerializer < ActiveModel::Serializer | |
attributes :id, :age, :name | |
has_many :birds |
%w[a b c].reduce({}) { |accum, char|
accum[char.to_sym] = char * 3; accum
}
# {:a=>"aaa", :b=>"bbb", :c=>"ccc"}
(into {}
(map (fn [char] [(keyword char) (apply str (repeat 3 char))])
(def items {:item_name_1 "Great Deal", | |
:item_options_2 "blah: 2", | |
:item_name_2 "Awesome Deal", | |
:item_options_1 "foo: 3", | |
:item_quantity_1 "1", | |
:item_price_2 "9.99", | |
:item_price_1 "9.99", | |
:itemCount "2"}) | |
(def item-keys |
items = { item_name_1: "Great Deal", | |
item_options_2: "blah: 2", | |
item_name_2: "Awesome Deal", | |
item_options_1: "foo: 3", | |
item_quantity_1: "1", | |
item_price_2: "9.99", | |
item_price_1: "9.99", | |
itemCount: "2" } | |
def item_key_index(key) |
free:
free:
paid:
free: