Skip to content

Instantly share code, notes, and snippets.

View Tjoosten's full-sized avatar
🌏
Somewhere between home and Hogwarts School of Witchcraft and Wizardry

Tim Joosten Tjoosten

🌏
Somewhere between home and Hogwarts School of Witchcraft and Wizardry
  • Polar Youth
  • Antwerp, BE
  • 15:14 (UTC +02:00)
  • X @x0rif
View GitHub Profile

Stuff I did to debug during API dev on my local machine

Run the PHP dev server on your given port

php -S 0.0.0.0:8080 -t public public/index.php

In httpie, pass ?XDEBUG_SESSION_START=foobar on the query string with the request

@Tjoosten
Tjoosten / 01_Laravel 5 Simple ACL manager_Readme.md
Created November 7, 2015 02:35 — forked from amochohan/01_Laravel 5 Simple ACL manager_Readme.md
Laravel 5 Simple ACL - Protect routes by an account / role type

#Laravel 5 Simple ACL manager

Protect your routes with user roles. Simply add a 'role_id' to the User model, install the roles table and seed if you need some example roles to get going.

If the user has a 'Root' role, then they can perform any actions.

Installation

Simply copy the files across into the appropriate directories, and register the middleware in App\Http\Kernel.php

@Tjoosten
Tjoosten / App\Exceptions\Handler.php
Created October 26, 2016 01:24 — forked from jacurtis/App\Exceptions\Handler.php
How to get filp/whoops to work in Laravel 5.2 or 5.3 - Add this code to your `App\Exceptions\Handler.php` file.
/**
* Create a Symfony response for the given exception.
*
* @param \Exception $e
* @return mixed
*/
protected function convertExceptionToResponse(Exception $e)
{
if (config('app.debug')) {
$whoops = new \Whoops\Run;
@Tjoosten
Tjoosten / git_submodules.md
Created August 15, 2017 02:35 — forked from gitaarik/git_submodules.md
Git Submodules basic explanation

Git Submodules basic explanation

Why submodules?

In Git you can add a submodule to a repository. This is basically a repository embedded in your main repository. This can be very useful. A couple of advantages of using submodules:

  • You can separate the code into different repositories.
@Tjoosten
Tjoosten / git_submodules.md
Created August 15, 2017 02:35 — forked from gitaarik/git_submodules.md
Git Submodules basic explanation

Git Submodules basic explanation

Why submodules?

In Git you can add a submodule to a repository. This is basically a repository embedded in your main repository. This can be very useful. A couple of advantages of using submodules:

  • You can separate the code into different repositories.
@Tjoosten
Tjoosten / CanAssertFlash.php
Created January 27, 2020 18:01 — forked from sandervanhooft/CanAssertFlash.php
Assert flash for Laracasts/flash
<?php
namespace Tests;
trait CanAssertFlash
{
protected function assertFlash($level, $message, $important = false, $title = null, $overlay = false)
{
$expectedNotification = [
'title' => $title,
@Tjoosten
Tjoosten / auth-standard-requirements.md
Created August 5, 2021 16:12 — forked from DragonBe/auth-standard-requirements.md
The common pattern for user registration, sign in, reset and removal of an account written out

Auth Stnadard Requirements

Problem statement

To tackle the common application pattern for authenticating, registering, resetting credentials, verifying, and unregistering from an application, the common patterns exists but many implementations make it hard to use the best solutions of different frameworks. While almost each application has this requirement, no standard has been defined.

Possible reasons why it's difficult

  • Too many backend solutions for storing and updating credentials (DB, LDAP/AD, API, SSO, SAML, …)
  • Added complexity when authorisation is required
  • Added complexity when MFA is required