Skip to content

Instantly share code, notes, and snippets.

View roquie's full-sized avatar
🎯
Focusing

Maks roquie

🎯
Focusing
View GitHub Profile
"""
http://amoffat.github.io/sh/
"""
import asyncio
from collections import deque
try:
from collections.abc import Mapping
except ImportError: # pragma: no cover
from collections import Mapping
@roquie
roquie / SortableUuidValueObject.php
Last active September 12, 2022 17:44
Cycle ORM typecaster
<?php
declare(strict_types=1);
namespace App\Domain\Common;
use Ramsey\Uuid\Uuid;
use Ramsey\Uuid\UuidInterface;
final class SortableUuid implements \Stringable
<?php
// file1
// bind UserRepositoryInterface to EloquentUserRepository object
class EloquentUserRepository extends UserRepositoryInterface
{
// ...
public function all()
{
return $this->model->all();
@roquie
roquie / AuthServiceProvider.php
Created July 27, 2018 14:53
Laravel 5.6 Cartalyst Sentinel Integration
<?php
declare(strict_types=1);
namespace App\Providers;
use Auth;
use Domain\SentinelGuard;
use Illuminate\Foundation\Support\Providers\AuthServiceProvider as ServiceProvider;
@roquie
roquie / lumen-stdout.php
Created June 15, 2018 19:34
Write Lumen framework log entities to stdout.
// bootstrap/app.php
```php
<?php
$app->extend(\Psr\Log\LoggerInterface::class, function ($logger) {
$logger->popHandler();
$logger->pushHandler(new \Monolog\Handler\ErrorLogHandler());
return $logger;
});
```
<?php
namespace App\Criteria;
use App\User;
use Auth;
/**
* Глобальный скоуп сужающий
* выборку до данных пользователя (where user_id = ${CURRENT_USER_ID}).
root@roquie-hetzner-2 ~ # flynn-host ps
ID STATE CREATED CONTROLLER APP CONTROLLER TYPE ERROR
roquiehetzner2-2db06c5e-b279-4bd4-af2a-2377bf01188a running 51 seconds ago controller web
roquiehetzner2-8cdadeca-a831-46d8-bcfc-8e259a1b6eaf running About a minute ago controller web
roquiehetzner2-aba5c7ff-01fc-41db-ae67-391b3a9ea3d4 running 2 minutes ago controller web
roquiehetzner2-509d8e5e-a8db-42c1-a0c6-3fc40e980e78 running 3 minutes ago controller web
roquiehetzner2-0ed7ad8d-8907-4380-ab34-56bd169bc287 running 4 minutes ago controller web
roquiehetzner2-0089d27f-92e3-49c6-b1f8-b9db8dbb89be running 5 minutes ago controller web
roquiehetzner2-00b23195-a0d7-46f9-b2de-6f46c12edc1d running 6 minutes ago controller web
roquiehetzner2-6762c3be-c500-4328-afb9-4a0a5559b67d running 7 minutes ago controller web
{
"serviceName": "M2MSIMCardLimitList",
"errorCode": "12546304",
"userMessage": "Недостаточно прав для доступа к выбранной функции",
"developerMessage": "com.peterservice.openapi.m2m.backend.exceptions.PermissionException: \n\tat com.peterservice.openapi.m2m.backend.camel.InitProcessor.process(InitProcessor.java:90)\n\tat org.apache.camel.processor.DelegateSyncProcessor.process(DelegateSyncProcessor.java:63)\n\tat org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:398)\n\tat org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:191)\n\tat org.apache.camel.processor.Pipeline.process(Pipeline.java:118)\n\tat org.apache.camel.processor.Pipeline.process(Pipeline.java:80)\n\tat org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:191)\n\tat org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:105)\n\tat org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncPro
2017-07-31T20:35:14.000Z weave: INFO: 2017/07/31 20:35:14.388842 Command line options: map[trusted-subnets: ipalloc-range: nickname:Ubuntu-1604-xenial-64-minimal port:6783 status-addr:127.0.0.1:6782 http-addr:127.0.0.1:6784 name:e2:17:6d:eb:53:45 resolv-conf:/var/run/weave/etc/resolv.conf datapath:datapath dns-domain:kontena.local dns-effective-listen-address:172.17.0.1 dns-listen-address:172.17.0.1:53]
2017-07-31T20:35:14.000Z weave: INFO: 2017/07/31 20:35:14.389231 Communication between peers via untrusted networks is encrypted.
2017-07-31T20:35:14.000Z weave: INFO: 2017/07/31 20:35:14.495586 Our name is e2:17:6d:eb:53:45(Ubuntu-1604-xenial-64-minimal)
2017-07-31T20:35:14.000Z weave: INFO: 2017/07/31 20:35:14.496004 Launch detected - using supplied peer list: []
2017-07-31T20:35:14.000Z weave: INFO: 2017/07/31 20:35:14.498975 Docker API on unix:///var/run/docker.sock: &[GitCommit=78d1802 GoVersion=go1.6.2 Os=linux Arch=amd64 KernelVersion=4.8.0-58-generic BuildTime=2017-01-31T23:35:14.312544877+00:00 Versio
max@Roquie-mac:~/google_drive/infra/kontena-ansible$ kontena grid logs -t
weave | INFO: 2017/07/31 20:35:14.388842 Command line options: map[trusted-subnets: ipalloc-range: nickname:Ubuntu-1604-xenial-64-minimal port:6783 status-addr:127.0.0.1:6782 http-addr:127.0.0.1:6784 name:e2:17:6d:eb:53:45 resolv-conf:/var/run/weave/etc/resolv.conf datapath:datapath dns-domain:kontena.local dns-effective-listen-address:172.17.0.1 dns-listen-address:172.17.0.1:53]
weave | INFO: 2017/07/31 20:35:14.389231 Communication between peers via untrusted networks is encrypted.
weave | INFO: 2017/07/31 20:35:14.495586 Our name is e2:17:6d:eb:53:45(Ubuntu-1604-xenial-64-minimal)
weave | INFO: 2017/07/31 20:35:14.496004 Launch detected - using supplied peer list: []
weave | INFO: 2017/07/31 20:35:14.498975 Docker API on unix:///var/run/docker.sock: &[GitCommit=78d1802 GoVersion=go1.6.2 Os=linux Arch=amd64 KernelVersion=4.8.0-58-generic BuildTime=2017-01-31T23:35:14.312544877+00:00 Version=1.12.6 ApiVersion=1.24]
weave | INFO: 2017/0