Skip to content

Instantly share code, notes, and snippets.

View spekkionu's full-sized avatar

Jonathan Bernardi spekkionu

View GitHub Profile
@spekkionu
spekkionu / autoload.php
Created February 3, 2014 20:54
Build Slim framework as phar
<?php
require('Slim/Slim.php');
\Slim\Slim::registerAutoloader();
@spekkionu
spekkionu / breadcrumbs.sql
Created April 14, 2016 06:59
Get breadcrumbs for nested set
SELECT
GROUP_CONCAT(
ancestor.name
ORDER BY ancestor.lft ASC
SEPARATOR ' > '
),
child.*
FROM `categories` child
JOIN `categories` ancestor
ON child.lft >= ancestor.lft
@spekkionu
spekkionu / composer.json
Created October 9, 2014 20:07
Standalone validation using laravel validation component
{
"name": "spakkionu/validate",
"description": "Validation Test",
"require": {
"illuminate/validation": "~4.2.9"
},
"license": "MIT",
"authors": [
{
"name": "Jonathan Bernardi",
@spekkionu
spekkionu / build.php
Created February 3, 2014 20:49
Build Symfony console component as phar
#!/usr/bin/php -dphar.readonly=0
<?php
$srcRoot = realpath(__DIR__."/vendor");
$buildRoot = realpath(__DIR__);
$iterator = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($srcRoot, FilesystemIterator::SKIP_DOTS), RecursiveIteratorIterator::LEAVES_ONLY);
/*
foreach($iterator as $file){
var_dump($file->getFilename());