Skip to content

Instantly share code, notes, and snippets.

View necromant2005's full-sized avatar

Rostyslav Mykhajliw necromant2005

View GitHub Profile
@necromant2005
necromant2005 / Phalcon-Zephir.md
Created March 17, 2016 04:33 — forked from denji/Phalcon-Zephir.md
Zephir write your PHP Extension

About this article will do the following things:

  • Install & Setup
  • Write a simple Router
  • Zephir rewritten version
  • Extension installation and testing

Installation

<?php
namespace Layout\ServiceManager\AbstractFactory;
use Interop\Container\ContainerInterface;
use Zend\ServiceManager\AbstractFactoryInterface;
use Zend\ServiceManager\ServiceLocatorInterface;
class Factory implements AbstractFactoryInterface
{
const INJECTIONS = 'injections';
const PARAMETERS = 'parameters';
/**
<?php
namespace Layout\View\Helper\Initializer;
use Layout\View\Helper\LandingHandler;
use Test\Framework\Environment\Stub\Mvc\Controller\PluginManager;
use Test\Framework\Environment\Stub\ServiceManager\ServiceManager;
use Test\Framework\TestCase\TestCase;
use Zend\Http\PhpEnvironment\Request;
<?php
require __DIR__ . '/vendor/autoload.php';
use React\EventLoop\Factory as EventLoopFactory;
use WyriHaximus\React\ChildProcess\Pool\Pool\Fixed as FixedPool;
use WyriHaximus\React\ChildProcess\Pool\ProcessCollection\ArrayList as ProcessCollectionArrayList;
use React\ChildProcess\Process;
$tasks = [];
<?php
require __DIR__ . '/vendor/autoload.php';
use React\EventLoop\Factory as EventLoopFactory;
use WyriHaximus\React\ChildProcess\Pool\Pool\Fixed as FixedPool;
use WyriHaximus\React\ChildProcess\Pool\ProcessCollection\ArrayList as ProcessCollectionArrayList;
use React\ChildProcess\Process;
$tasks = [];
@necromant2005
necromant2005 / run.sh
Created February 6, 2019 09:33
Include script content directly to docker container without directory mounting
#!/bin/bash
_CONTENT=$(echo $1 | base64 --decode)
_FILENAME=`echo $2 | base64 --decode`
_CMD=`echo $3 | base64 --decode`
echo $_CONTENT > $_FILENAME
echo `$_CMD`