$tcpRPC = new Goridge\RPC\RPC(Goridge\Relay::create('tcp://go_worker:6001'));
const itemRef = document.querySelector('.item')
let move = (e) => {
const x = e.offsetX
itemRef.animate([{
transform: `scale(1.6) rotate(${x}deg)`,
}], {duration: 1000, fill: 'forwards'})
}
itemRef.addEventListener('mouseleave', (e) => {
itemRef.removeEventListener('mousemove', move)
itemRef.animate([{
transform: 'none',
}], {duration: 1000, fill: 'forwards'})
})
itemRef.addEventListener('mouseenter', (e) => {
itemRef.addEventListener('mousemove', move)
})
<?php
namespace App\Http\Middleware;
use Closure;
use Illuminate\Http\Request;
use Illuminate\Support\Str;
use Symfony\Component\HttpFoundation\Response;
class UriIsGone
{
public function handle(Request $request, Closure $next): Response
{
if (Str::contains(request()->getRequestUri(), '?')) {
return \response("Gone error", 410);
}
return $next($request);
}
}
<?php
namespace App\Jobs;
use Illuminate\Queue\Middleware\WithoutOverlapping;
trait WithoutOverlappingFileWrite
{
public function middleware(): array
{
return [
(new WithoutOverlapping('file_write'))
->shared() // https://laravel.com/docs/11.x/queues#sharing-lock-keys
];
}
public function retryUntil(): \Illuminate\Support\Carbon
{
return now()->addSeconds(60);
}
}
<p><input type="checkbox" name="list[]" value="кто-нибудь"> кто-нибудь</p>
<p><input type="checkbox" name="list[]" value="еще кто-нибудь"> еще кто-нибудь</p>
$name = $_POST['name'];
$list = implode(",", $_POST['list']);
$query = "INSERT INTO `conversatons` VALUES ('$name', '$list'); ";
function getItem($title, $url, $img) {
return '<div class="item">
<div class="blogodel">
<a href="'.trim($url).'" onClick="_gaq.push([\'_trackEvent\', \'Test1.Click\', \'Click\', \'Test1\']);">
<img src="'.trim($img).'" alt=""><div class="desc"><strong>★ ★ ★ ★ ☆</strong> Played: 95741236 times</div>
'.trim($title).'
</a>
</div></div>';
}
(function($){
// Количество секунд в каждом временном отрезке
var days = 24*60*60,
hours = 60*60,
minutes = 60;
$.fn.timer = function(callback){
callback = callback ? callback : function(){}
return new $.ctimer(this, callback);
}
$.ctimer = function(element, callback) {
callback = callback || function(){}
var secs = parseInt(element.html());
function tick(){
// Осталось дней
var sec = secs;
var d = Math.floor(sec / days);
sec -= d*days;
// Осталось часов
var h = Math.floor(sec / hours);
sec -= h*hours;
// Осталось минут
var m = Math.floor(sec / minutes);
sec -= m*minutes;
// Осталось секунд
var s = sec;
h = (h+"").length<2 ? "0"+h : h;
m = (m+"").length<2 ? "0"+m : m;
s = (s+"").length<2 ? "0"+s : s;
if(secs==0){
element.html(null);
callback();
return false;
}
secs--;
element.html(d+" дн. "+h+":"+m+":"+s);
setTimeout(tick, 1000);
}
tick();
}
})(jQuery);
comlib.GetMessages = function(callback)
{
$.ajax
({
url: "get_messages.php",
type: 'get',
success: function( data )
{
callback(data);
}
});
}
comlib.GetMessages(function(data){
console.info(data); // выведет ответ Ajax
})
$day1 = mktime(0, 0, 0, date("m"), date("d")-7, date("Y"));
$day2 = mktime(0, 0, 0, date("m"), date("d")-6, date("Y"));
$sql = "SELECT * FROM table WHERE UNIX_TIMESTAMP(createdon) > $day1 AND UNIX_TIMESTAMP(createdon) < $day2";
$result = mysql_query($sql);
$data = array();
while($row = mysql_fetch_assoc($result))
{
if(!isset($data[$row['email']])){
$data[$row['email']] = array();
}
$data[$row['email']][] = $row;
}
var_dump($data);