Skip to content

Instantly share code, notes, and snippets.

View dutymess's full-sized avatar
😡
Hates the Racist Github

Taha Kamkar dutymess

😡
Hates the Racist Github
View GitHub Profile
<?php
namespace arashrasoulzadeh\auth\src\traits;
use arashrasoulzadeh\auth\src\model\UserAuthMetas;
trait UserMetaTrait
{
/** @var array
@meysampg
meysampg / array_to_tree.php
Created April 27, 2019 17:10
Create a tree from a flat array (like data retrieved from DB)
<?php
// Data from stackoverflow
$a = array(
array('id'=>100, 'parentid'=>0, 'name'=>'a0'),
array('id'=>102, 'parentid'=>101, 'name'=>'a012'),
array('id'=>103, 'parentid'=>101, 'name'=>'a011'),
array('id'=>101, 'parentid'=>100, 'name'=>'a01'),
array('id'=>104, 'parentid'=>100, 'name'=>'a02'),
);
@meysampg
meysampg / zeshter.php
Last active October 10, 2019 09:05
Zeshter function remove all comments and docblocks from a given php file or a folder of php files.
#!/usr/bin/env php
<?php
/**
* Zeshter function remove all comments and docblocks from a given
* php file or a folder of php files. Yep, it just mirine into file.
*
* @param string|null $path path of a php file or a folder contains php files
*/
function zeshter(?string $path, bool $debugMode = false)
{