curl -SsL https://packages.httpie.io/deb/KEY.gpg | apt-key add -
curl -SsL -o /etc/apt/sources.list.d/httpie.list https://packages.httpie.io/deb/httpie.list
apt update
apt install httpie
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
location ^~ /.well-known/acme-challenge/ { | |
allow all; | |
root /var/lib/letsencrypt/; | |
default_type "text/plain"; | |
try_files $uri =404; | |
} |
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 | |
require './../vendor/autoload.php'; | |
use NexOtaku\MinimalFilesystem\Filesystem; | |
use PhpParser\ParserFactory; | |
use PhpParser\{Node, NodeTraverser, NodeVisitorAbstract}; | |
class CallMap | |
{ |
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 App\Module\ModelMaker; | |
use Illuminate\Console\Command; | |
use Illuminate\Console\Concerns\InteractsWithIO; | |
use Illuminate\Support\Facades\DB; | |
use Illuminate\Support\Str; | |
use NexOtaku\MinimalFilesystem\Filesystem; | |
use NunoMaduro\LaravelConsoleMenu\Menu; |
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 App\Module\Demo\Xo; | |
use App\Module\Runtime\FilesystemRuntimeState; | |
use App\Module\Runtime\MemoryCachedRuntimeState; | |
use App\Module\Runtime\Types\StoredString; | |
class Xo | |
{ |
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 App; | |
class Act | |
{ | |
private int $id; | |
private string $title; | |
private ?\DateTimeInterface $signedAt; |
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
version: '3' | |
services: | |
# PHP | |
yarko_php_service: | |
image: yarko_php_image | |
build: | |
context: . | |
dockerfile: ./docker/php/Dockerfile | |
container_name: yarko_php_container |
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
// https://www.npmjs.com/package/telegramify-markdown | |
const telegramifyMarkdown = require('telegramify-markdown'); | |
const escapeMarkdownV2 = (text) => { | |
// Функция telegramifyMarkdown не совсем корректно работает, глючит с форматом __Underlined__, | |
// поэтому обходим этот глюк с помощью замены "__" на "@@" и обратно. | |
const dogText = text.replace(/__/gi, '@@'); | |
const lines = dogText.split('\n'); | |
const percentText = lines.map(line => { |
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 | |
/** | |
We want to use our custom component e.g. Tracker with Dependecy Injection and all the nice features, | |
but make it totally independent of framework. | |
Make it SOLID ) | |
It would be shame to extend our custom component from framework classes, because it would be a hard dependency from framework. | |
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 yii\helpers\StringHelper; | |
class ImageOptimizerHelper | |
{ | |
public static function optimize($path) | |
{ | |
// Оптимизируем изображение с помощью расширения "ps/image-optimizer". | |
// Утилита сама определяет формат и выбирает подходящие настройки оптимизации. |
NewerOlder