[
{
"method": "controller:method1",
"params": {},
"id": 1
},
{
"method": "controller:method2",
"params": {},
"id": 2,
"wait": 1
},
{
"method": "controller:method2",
"params": {},
"id": 3,
"wait": 1
},
{
"method": "controller:method2",
"params": {},
"id": 4,
"wait": 2
}
{
"method": "controller:method2",
"params": {},
"id": 5
}
]
[
[
{
"method": "controller:method1",
"params": {},
"id": 1
},
{
"method": "controller:method2",
"params": {},
"id": 5
}
],
[
{
"method": "controller:method2",
"params": {},
"id": 2,
"wait": 1
},
{
"method": "controller:method2",
"params": {},
"id": 3,
"wait": 1
},
],
[
{
"method": "controller:method2",
"params": {},
"id": 4,
"wait": 2
}
]
]
for _, step := range steps {
for _, f : range step {
f.method(f.params)
}
}
SELECT `p`.*
FROM `products` AS `p`
JOIN `PropertyPivot` AS `pp1` ON `pp1`.`product_id` = `p`.`id`
AND `pp1`.`property_id` = :p1_property AND `pp1`.`option_id` = :p1_value
JOIN `PropertyPivot` AS `pp2` ON `pp2`.`product_id` = `p`.`id`
AND `pp2`.`property_id` = :p2_property AND `pp2`.`option_id` = :p2_value
SELECT product_id
FROM PropertyPivot
WHERE property_id IN (...) AND option_id IN (...)
GROUP BY product_id
HAVING count(*) = количество параметров поиска
//div[contains(@class, "some-class")]/div/span[1]/following-sibling::text()
//div[contains(@class, "some-class")]/div/text()[normalize-space()]
$array = ['title'=>'TITLE','slug'=>'URL','contet'=>'CONTENT.....'];
foreach ($array as $key => $value) {
$$key = $value;
}
echo $title; // TITLE
echo $slug; // URL
echo $contet; // CONTENT.....
<?
$first = "second";
$second = "third";
echo $first; //second
echo "\n";
echo $$first; //third
?>
var list = document.getElementsByTagName('ul');
console.log(list);
console.log(list.length);
kill -USR2 `cat tmp/pids/unicorn.pid`
namespace :unicorn do
pid_path = "#{release_path}/tmp/pids"
unicorn_pid = "#{pid_path}/unicorn.pid"
def run_unicorn
execute "#{fetch(:bundle_binstubs)}/unicorn", "-c #{release_path}/config/unicorn.rb -D -E #{fetch(:stage)}"
end
desc 'Start unicorn'
task :start do
on roles(:app) do
run_unicorn
end
end
desc 'Stop unicorn'
task :stop do
on roles(:app) do
if test "[ -f #{unicorn_pid} ]"
execute :kill, "-QUIT `cat #{unicorn_pid}`"
end
end
end
desc 'Force stop unicorn (kill -9)'
task :force_stop do
on roles(:app) do
if test "[ -f #{unicorn_pid} ]"
execute :kill, "-9 `cat #{unicorn_pid}`"
execute :rm, unicorn_pid
end
end
end
desc 'Restart unicorn'
task :restart do
on roles(:app) do
if test "[ -f #{unicorn_pid} ]"
execute :kill, "-USR2 `cat #{unicorn_pid}`"
else
run_unicorn
end
end
end
end