bundle show <name_gem>
EDITOR=vim bundle open <name_gem>
cd <path>
gem unpuck <name_gem> (если без git`a)
git clone --bare <адрес> (если с git)
#... правки gem`a ...
# Вариант 1. Настройки Bundle, говорим, что <name_gem> локальный (главное не забыть об этом)
bundle config local.spree <path>/<name_gem>
# Вариант 2: Gemfile:
gem 'name_gem', path: <path> # локально
gem 'name_gem', :git => '<repo path/url>', :branch => 'you_hack_branch'
= will_paginate(.... :renderer =>
a = [{"yyyy-mm-dd" => 2}, {"yyyy-mm-dd" => 6}]
b = [{"2014-01-01" => 0} ... {"2014-12-31" => 0}]
ah = Hash[*a.map(&:to_a).flatten]
bh = Hash[*b.map(&:to_a).flatten]
result = bh.merge(ah).map{|k,v| {k => v}}
ah = {}.tap{ |out| a.each{ |h| h.each{ |k,v| (out[k]||=[]) << v } } }
bh = Hash[*b.map(&:to_a).flatten]
result = bh.merge(ah).map{|k,v| {k => v}}
params[:pages].each_with_index
def to_partial_path
priority? ? 'mini_post' : super
end
<%= render @posts %>
body > div {
display: flex;
flex-flow: column wrap;
height: 600px;
align-content: flex-start;
}
div > div {
width: 200px;
height: 150px;
border: 1px solid #ccc;
margin: 10px;
}
div > div:nth-of-type(4) {
height: 300px;
}
div > div:nth-of-type(5) {
height: 200px;
}
.wrap{
position: relative;
}
.wrap-scroll{
margin-left: 100px;
width: 300px;
overflow: auto;
}
table{
width: 500px;
}
table td{
width: 100px;
border: 1px solid #ccc;
}
table tr td:first-child{
width: 100px;
position: absolute;
left: 0px;
z-index: 100;
}
<div class="wrap">
<div class="wrap-scroll">
<table>
<tbody>
<tr>
<td>Col-1</td>
<td>1</td>
<td>2</td>
<td>3</td>
<td>4</td>
<td>5</td>
</tr>
<tr>
<td>Col-2</td>
<td>1</td>
<td>2</td>
<td>3</td>
<td>4</td>
<td>5</td>
</tr>
</tbody>
</table>
</div>
</div>
SELECT a1.id, a1.name
FROM users AS a1 LEFT JOIN users AS a2
ON a1.name = a2.name AND a1.id <= a2.id
GROUP BY a1.id, a1.name
HAVING
(a1.name = 'dasha' AND COUNT(*) <=3)
OR
(a1.name = 'masha' AND COUNT(*) <=5)
ORDER BY a1.name;
SELECT * FROM (
SELECT a1.id, a1.name, count(*) AS n
FROM users AS a1 LEFT JOIN users AS a2
ON a1.name = a2.name AND a1.id <= a2.id GROUP BY a1.id, a1.name
) AS t
WHERE (t.name = 'dasha-1' and t.n <= 3) OR (t.name = 'dasha-2' and t.n <= 5)
ORDER BY t.name;
(SELECT ...) UNION (...)
find("label[for^='cat-17']").click
expect(page).to have_selector("#task_subcategories_12")
expect(page).to have_selector("#task_subcategories_12", visible: false)