Skip to content

Instantly share code, notes, and snippets.

View yoeunes's full-sized avatar
🇲🇦

Younes ENNAJI yoeunes

🇲🇦
View GitHub Profile
<?php
namespace App\Libraries;
/**
* Class able to convert a flat array with parent ID's to a nested tree
*/
class FlatToTreeConverter
{
/**
@auipga
auipga / sfperm.sh
Created August 21, 2018 07:51
Setting up or Fixing File Permissions (Symfony)
#!/usr/bin/env bash
# see http://symfony.com/doc/3.4/setup/file_permissions.html
function show_help
{
# General help text
cat << EOF
Script for Setting up or Fixing File Permissions for Symfony applications
Usage: sfperm <option>
@Flard
Flard / repair-serialized-array.php
Created October 26, 2016 08:27
Fix voor repair serialized array.
<?php
/**************************************************************************
repairSerializedArray()
--------------------------------------------------------------------------
Extract what remains from an unintentionally truncated serialized string
Example Usage:
// the native unserialize() function returns false on failure
$data = @unserialize($serialized); // @ silences the default PHP failure notice