Skip to content

Instantly share code, notes, and snippets.

View SerafimArts's full-sized avatar
wazzup?

Kirill Nesmeyanov SerafimArts

wazzup?
View GitHub Profile
@SerafimArts
SerafimArts / Lexer.php
Last active September 5, 2023 16:43
PHP Language lexer
<?php
/**
* Exec "composer require railt/lexer ~1.2"
*/
declare(strict_types=1);
namespace Example;
use Railt\Io\Readable;
use Railt\Lexer\Definition\TokenDefinition;
<?php
declare(strict_types=1);
class Pool
{
/**
* @var \Generator[]|array[]
*/
private $iterators = [];
@SerafimArts
SerafimArts / Collection.js
Last active February 20, 2018 02:15
High Order Messaging in JS
export default class Collection<T> {
/**
* The items contained in the collection.
*/
_items: Iterable<T>;
/**
* Create a new collection.
*
* @param items
<?php
function This an EPIC test for the King()
{
return __FUNCTION__ . ' says ' . 42;
}
echo This an EPIC test for the King();
@SerafimArts
SerafimArts / index.graphqls
Created August 18, 2017 14:08
Railgun example app
#
# file ~/schema/index.graphqls
#
schema {
query: Query
}
type Query {
user: User
@SerafimArts
SerafimArts / example.graphqls
Created July 21, 2017 15:54
GraphQL IDL reader based on Yay PHP
type Story implements Test {
id: ID! @test(some: "any")
text: String!
isPublished: Boolean
author: Author!
comments: [Comment!]!
}
type Author {
id: ID!
<?php
/**
* This file is part of laravel.su package.
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
declare(strict_types=1);
@SerafimArts
SerafimArts / Annotation.js
Last active October 24, 2023 22:47
JavaScript Annotations example
import Reader from './Reader';
import Target from './Target';
/**
* This is default annotation property for automatic type casting:
* <code>
* @Annotation({ some: any })
* // => will be casts "as is" {some: any}
*
* @Annotation("any")
<?php declare(strict_types = 1);
/**
* This file is part of MessageComponent package.
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Serafim\MessageComponent;
use Illuminate\Contracts\Support\Renderable;
@SerafimArts
SerafimArts / EnvironmentInstaller.php
Last active October 26, 2016 12:18
Laravel environment installer
<?php
/**
* Put this file to "app/Console/EnvironmentInstaller.php"
*/
namespace App\Console;
use Dotenv\Dotenv;
use Composer\Script\Event;
use Illuminate\Support\Str;
use Composer\IO\IOInterface;