Skip to content

Instantly share code, notes, and snippets.

Daniel Opitz odan

View GitHub Profile
View User Authentication

User authentication system

Your task is now to create a user authentication system.

This document will guide you through all the features and implication of such system, so that you don't have to search them yourself.

We will focus on web/browser-technologies, however similar concept can be widely applied. This guide, is a work in progress, feel free to comment and provide feedbacks.

Expected Workflows

View TypeInspector.php
namespace App\Utility;
use DomainException;
use ReflectionClass;
* Type inspector.
odan / Slim 4
Last active Jun 30, 2020
Slim 4 Tutorial
View Slim 4
odan /
Last active Oct 9, 2019
Twitter images

Twitter Images (2019)

  • Header photo: 1500 x 500 px

  • Profile photo: 400 x 400 px

  • Tweet image: Minimum 440 x 220 px, Desktop: 506 x 253 px, Maximum: 1024 x 512 px

  • Image types include: JPG, GIF or PNG.


odan /
Last active Jul 2, 2020
Creating a mocked local filesystem adapter with vfsStream

Creating a mocked local Flysystem adapter with vfsStream

Note: In this example I doesn't use the flysystem Memory or Null adpater, because the Memory adapter doesn't implement the getPathPrefix method, like the AbstractAdapter does. For this reason I use the Local adapter in LOCK_NB mode in combination with vfsStream to simulate the filesystem in-memory.


composer require mikey179/vfsstream --dev
odan /
Last active Oct 3, 2019
Mock Ramsey\Uuid

Mock Ramsey\Uuid

The mock method

use Ramsey\Uuid\Generator\RandomGeneratorInterface;
use Ramsey\Uuid\Uuid;
use RuntimeException;
// ...
odan /
Last active May 18, 2020
Slim 4 - CORS with preflight request
You can’t perform that action at this time.