Skip to content

Instantly share code, notes, and snippets.

function pipe( ...$transformers )
{
    return function( $value ) use( $transformers )
    {
        return array_reduce( 
            $transformers, 
            fn( $buffer, $transformer ) => $transformer( $buffer ), 
class ForLoop
{
    private $from;
    private $to;
    private $vars = [];

    function init()
    {
"editor.matchBrackets": "never",
"editor.occurrencesHighlight": false,
"editor.lineHeight": 2.6,
"[yaml]":  {
 "editor.insertSpaces": true,
 "editor.tabSize": 2,
 "editor.autoIndent": "none"
},
"editor.renderLineHighlight": "none",
function li( $str )
{
    return pipe( "<li> $str </li>" );
}

function h1( $str )
{
    return pipe( "<h1> $str </h1>" );

Create a Docker Tool Image

FROM php
LABEL maintainer "nezarfadle@gmail.com" 
RUN php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
RUN php -r "if (hash_file('sha384', 'composer-setup.php') === '756890a4488ce9024fc62c56153228907f1545c228516cbf63f885e036d37e9a59d27d63f46af1d4d07ee0f76181c7d3') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
RUN php composer-setup.php
RUN php -r "unlink('composer-setup.php');"
RUN mv composer.phar /usr/bin/composer
RUN chmod +x /usr/bin/composer
[
{
"description":"Flower",
"image":"https://i.pinimg.com/originals/9d/0e/95/9d0e95a207231b44c265a8fef32d7127.jpg"
},
{
"description":"Car",
"image":"https://i.pinimg.com/originals/3c/d7/0c/3cd70ca19d90589c9b01d5ed8d16f417.png"
}
]
<?php

interface IObserver
{
    public function run( $o );
}

interface IObservable
{
#include <iostream>
#include "assert.h"
#include <exception>

using namespace std;

class EmptyStackException : public std::exception {};
class FullStackException : public std::exception {};
template<class T, int max>
@nezarfadle
nezarfadle / index.html.md
Last active May 4, 2020 18:56
PHP Server Send Events
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>