Skip to content

Instantly share code, notes, and snippets.

View azjezz's full-sized avatar
😶

Saif Eddin Gmati azjezz

😶
View GitHub Profile
@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 / 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 <azjezz@protonmail.org>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
<<__ReturnDisposable>>
function closeOnScopeExit<<<__Enforceable>> reify T as Mode>(
Handle<T> $handle,
): DisposableHandle<T> {
return new DisposableHandle<T>($handle);
}
@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'
@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 / 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 / better-app.php
Last active December 11, 2019 22:46
Improve the performance of your PHP 7.4 application
<?php
declare(strict_types=1);
namespace BetterApplication;
use FFI;
use Closure;
abstract class AbstractZendWriter
@azjezz
azjezz / storage.js
Last active May 7, 2020 19:37
simple storage class for javascript - test included
class Storage {
static get(key) {
let value = localStorage.getItem(key);
return value === null ? null : JSON.parse(value);
}
static set(key,value) {
return localStorage.setItem(key,JSON.stringify(value));
}
@azjezz
azjezz / Logger.hack
Created May 22, 2020 20:13
Nuxed basic console logger implementation
namespace Nuxed\Console\Log;
use namespace HH\Lib\Str;
use namespace Nuxed\Console;
use namespace Nuxed\Console\Output;
use namespace Nuxed\Contract\Log;
final class Logger implements Log\ILogger {
public function __construct(private Output\IOutput $output) {}

Keybase proof

I hereby claim:

  • I am azjezz on github.
  • I am azjezz (https://keybase.io/azjezz) on keybase.
  • I have a public key ASBG6C6v-7GwW-PBxKqaBF601YuVYZV1TN41DucA7xNz1Qo

To claim this, I am signing this object: