Skip to content

Instantly share code, notes, and snippets.

View edin's full-sized avatar
🎯
Focusing

Edin Omeragic edin

🎯
Focusing
View GitHub Profile
@edin
edin / VueMvvm.md
Created May 11, 2020 09:20
MVVM project structure for Vue

MVVM project structure for Vue

Oragnize project files like in following structure:

/src

  • Foundation
    • Client.ts
  • Services
    • LoginService.ts
    • AppClient.ts
@edin
edin / FunctionType.php
Created October 26, 2019 11:02
Wrapper for php callable
<?php
abstract class FunctionType {
public static function fn(callable $callable) {
$type = static::class;
$signature = self::getMethodSignature(static::class, "__invoke");
$code = "return new class (\$callable) extends $type {
private \$callable;
public function __construct(\$callable) {
\$this->callable = new \ReflectionFunction(\$callable);