This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace AppBundle\Mapping; | |
use Doctrine\ORM\Mapping as ORM; | |
use DateTime; | |
/** | |
* Class EntityBase | |
* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$di->setShared('queue', function () { | |
$queue = new \Lib\Queue(new \PhpAmqpLib\Connection\AMQPConnection( | |
'rabbitmq', #host - имя хоста, на котором запущен сервер RabbitMQ | |
5672, #port - номер порта сервиса, по умолчанию - 5672 | |
'guest', #user - имя пользователя для соединения с сервером | |
'guest' #password | |
, '/' | |
, 60 | |
)); | |
return $queue; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$app = new \Phalcon\Mvc\Micro($di); | |
\Core\CommonObject::i()->setApp($app); | |
\Core\CommonObject::i()->getDI()->getShared('queue')->pull('fake_detector', function ($result) { | |
$fake = new \Fake\Service\Fake($result['from_user_id'], $result['to_user_id'], $result['dev'], $result['bot_name'], $result['bot_secret']); | |
return $fake->run(); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Lib; | |
use PhpAmqpLib\Connection\AMQPConnection; | |
use PhpAmqpLib\Exception\AMQPTimeoutException; | |
use PhpAmqpLib\Message\AMQPMessage; | |
/** | |
* Class Queue |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void back(int x, int y) | |
{ | |
b--; | |
a = p[b]; | |
h[a] = 0; | |
du[a + b] = 0; | |
dd[a + N - b - 1] = 0; | |
a++; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
document.yes = 0; | |
document.no = 0; | |
document.city = "Тула"; | |
document.rating = 630; | |
// выполняем тело анонимной функции с интервалом в 100 милисекунд | |
setInterval(function(){ | |
// какой указан город | |
girlCity = $('.js-location-label').text(); | |
// Проверяем есть ли на странице город |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
use Phalcon\Db\Column; | |
use Phalcon\Db\Index; | |
use Phalcon\Db\Reference; | |
use Phalcon\Mvc\Model\Migration; | |
/** | |
* Class OauthAccessTokenScopesMigration_200 | |
*/ |