Skip to content

Instantly share code, notes, and snippets.

View katoba86's full-sized avatar

Kai Willam katoba86

View GitHub Profile
@katoba86
katoba86 / Graham_Hull.php
Last active April 22, 2022 08:12
Calculate a convex hull from a given array of x, y coordinate - Graham Algo - Pure PHP, no dependencies
<?php
namespace App\Common;
class Graham
{
@katoba86
katoba86 / CleanDBLogger.php
Created June 19, 2019 11:03
Error logging in a database is in Yii2 really not comfortably implemented. (My opinion). The additional row with the server information confused and is not good to read. Here's a small class, which makes sure that the prefix matches the URL name (if not available, the user IP) and adds the additional informations in the message.
<?php
namespace app\lib;
use yii\helpers\VarDumper;
use yii\log\DbTarget;
use yii\log\LogRuntimeException;
@katoba86
katoba86 / ArrayHelper.php
Created March 20, 2017 10:35
Array helper methods/functions - flatten / object2array / array2object / recursive unique
<?php
/**
* Created by PhpStorm.
* User: Kai Bartholome
* Date: 20.12.2016
* Time: 15:20
*/
namespace app\components;