Skip to content

Instantly share code, notes, and snippets.

View aierui's full-sized avatar
🎯
Focusing

YIXIAO SHI aierui

🎯
Focusing
View GitHub Profile
@aierui
aierui / exceptions-tree.php
Created June 27, 2018 23:55 — forked from mlocati/exceptions-tree.php
Throwable and Exceptions tree
<?php
if (!function_exists('interface_exists')) {
die('PHP version too old');
}
$throwables = listThrowableClasses();
$throwablesPerParent = splitInParents($throwables);
printTree($throwablesPerParent);
if (count($throwablesPerParent) !== 0) {
die('ERROR!!!');
@aierui
aierui / unique.js
Last active May 11, 2018 08:54
someUnique
// some unique snippets
var unique = function(a) {
return Array.from(new Set(a));
}
var unique = function (a){
a.filter(function(ele,index,array){
return index===array.indexOf(ele)