Skip to content

Instantly share code, notes, and snippets.

View azjezz's full-sized avatar
🎯
Focusing

Saif Eddin Gmati azjezz

🎯
Focusing
View GitHub Profile
@azjezz
azjezz / brainfuck.php
Last active November 15, 2019 10:55
Brainfuck Lexer and Interpreter written in PHP ( https://3v4l.org/9lEte )
<?php
declare(strict_types=1);
namespace AzJezz\BrainFuck;
use ArrayIterator;
use Iterator;
use RuntimeException;
@azjezz
azjezz / .hax.json
Last active November 8, 2019 23:40
Hax configuration
{
"name": "My Application",
"base-path": "app/",
"entry": "app/bin/application.hack",
"compression-algorithm": "gzip",
"signing-algorithm": "sha512",
"include": [
"app/src/*",
"app/vendor/*"
],
@azjezz
azjezz / connect.js
Last active October 31, 2019 19:47
function user(uuid) {
let headers = new Headers({
'Accept': 'application/json'
})
let request = new Request('https://connect.symfony.com/api/users/' + uuid, {
method: 'GET',
headers: headers,
mode: 'cors',
cache: 'default'
<<__ReturnDisposable>>
function closeOnScopeExit<<<__Enforceable>> reify T as Mode>(
Handle<T> $handle,
): DisposableHandle<T> {
return new DisposableHandle<T>($handle);
}
@azjezz
azjezz / MemoryHandle.hack
Last active October 15, 2019 21:27
MemoryHandle implementation. ( see hhvm/hsl-experimental#58 )
namespace Nuxed\IO;
/*
* This file is part of the Nuxed package.
*
* (c) Saif Eddin Gmati <[email protected]>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
@azjezz
azjezz / Extension.hack
Last active June 6, 2019 21:22
Nuxed Hello world
use namespace Nuxed\Kernel;
use namespace Nuxed\Container;
use namespace Nuxed\Http\Router;
use namespace Nuxed\Http\Router\Generator;
final class Extension extends Kernel\Extension\AbstractExtension {
// register container services
public function register(
Container\ContainerBuilder $builder,
): void {
@azjezz
azjezz / colors.css
Created May 8, 2019 23:41
Colors used at Polar
/** Colors **/
.primary {
color: #BDC6FF;
}
.secondary {
color: #F4C2C2;
}
.success {
color: #00cec9;
```
use namespace HH\Lib\Vec;
function process(
vec<(string, string, string, string)> $input
): dict<string, dict<string, dict<string, vec<string>>> {
$result = dict[];
foreach($input as $tuple) {
$result[$tuple[0]][$tuple[1]][$tuple[2]] = Vec\concat(
$result[$tuple[0]][$tuple[1]][$tuple[2]] ?? vec[],
$baz as Baz -> passed.
$qux as Baz -> failed : Expected Baz, got Qux.
$baz as Qux -> failed : Expected Qux, got Baz.
$qux as Qux -> passed.
$baz as Foo -> passed.
$qux as Foo -> passed.
$baz as Bar -> failed : Expected Bar, got Baz.
$qux as Bar -> passed.
$baz as string -> failed : Expected string, got Baz.
$baz as int -> failed : Expected int, got Baz.
require __DIR__.'/vendor/autoload.hack';
use namespace HH\Asio;
use namespace HH\Lib\Str;
use namespace Facebook\TypeAssert;
final class GithubPublicInformation {
const type TFileInfo = shape(
'sha' => string,
'filename' => string,