Skip to content

Instantly share code, notes, and snippets.

View zeromodule's full-sized avatar
🤖

zeromodule

🤖
  • Belgrade
  • 08:46 (UTC +03:00)
View GitHub Profile
FROM ubuntu:latest
WORKDIR /tmp
RUN echo -e "Some binary data\nSome more binary data" > /tmp/my-binary-data-file
CMD cp /tmp/my-binary-data-file /home/dev/tmp && sleep infinity
version: '3.3'
volumes:
my_binary_data:
services:
my-app1:
build:
context: .
dockerfile: Dockerfile
@zeromodule
zeromodule / MessageSend.php
Created January 9, 2020 10:08
FCM message send service
<?php
namespace Core\InfrastructureBundle\Service\Firebase;
use Core\ApplicationBundle\Interfaces\PassengerDeviceNotificationSenderInterface;
use Google\Auth\Credentials\ServiceAccountCredentials;
use GuzzleHttp\Client as HttpClient;
use Psr\Http\Message\StreamInterface;
class MessageSend implements PassengerDeviceNotificationSenderInterface
{
@zeromodule
zeromodule / sum_func.php
Created January 22, 2019 13:09
Сложение столбиком
<?php declare(strict_types=1);
/**
* Сложение "столбиком"
*/
function sum(string $a, string $b): string
{
$args = func_get_args();
foreach ($args as $key => $val) {
if ($val[0] === '0' || !preg_match('/^\d+$/', $val)) {
<?php
namespace Application\Migrations;
use Doctrine\DBAL\Migrations\AbstractMigration;
use Doctrine\DBAL\Schema\Schema;
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
use Symfony\Component\DependencyInjection\ContainerInterface;
/**
# modified: wp-config.php
# modified: wp-content/plugins/akismet/_inc/akismet.css
# modified: wp-content/plugins/akismet/_inc/akismet.js
# modified: wp-content/plugins/akismet/_inc/img/logo-full-2x.png
# modified: wp-content/plugins/akismet/akismet.php
# modified: wp-content/plugins/akismet/class.akismet-admin.php
# modified: wp-content/plugins/akismet/class.akismet.php
# modified: wp-content/plugins/akismet/readme.txt
# modified: wp-content/plugins/akismet/views/config.php
# modified: wp-content/plugins/akismet/views/get.php
<?php
namespace CoreDomain;
class Id
{
private $value;
public function __construct($value)
{
public void WithdrawMoney(decimal amount)
{
Atm atm = _repository.Get();
_atmService.WithdrawMoney(atm, amount);
_repository.Save(_atm);
}
public sealed class AtmService // Domain service
{
public void WithdrawMoney(Atm atm, decimal amount)
<?php
//класс для построения на его основе классов для доступа
//к объектам данных из БД (блоги, записи, комментарии, пользователи, ...).
//Предоставляет методы для работы как с одиночными объектами или их свойствами,
//так и с их группами.
//не абстрактный, т.к. иногда достаточно его экземпляра.
class DataObjects{
/**
<?php
class News
{
private $cache_section = 'news';
private $dbctrl;
function __construct()
{
$this->dbctrl = Base::initDB();
}