Skip to content

Instantly share code, notes, and snippets.

View spekkionu's full-sized avatar

Jonathan Bernardi spekkionu

View GitHub Profile
@spekkionu
spekkionu / build.php
Last active August 29, 2015 13:55
Build Zend\FilterInput as phar
#!/usr/bin/php -dphar.readonly=0
<?php
$srcRoot = realpath(__DIR__."/vendor");
$iterator = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($srcRoot, FilesystemIterator::SKIP_DOTS), RecursiveIteratorIterator::LEAVES_ONLY);
echo "Build ZF Form processing phar\n";
$phar = new Phar(__DIR__.'/zf-form.phar', 0, 'zf-form.phar');
$phar->buildFromIterator($iterator, $srcRoot);
@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());
@spekkionu
spekkionu / build.php
Created February 3, 2014 20:51
Builds monolog 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());
@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 / build.php
Created February 3, 2014 20:55
Build swiftmailer as phar
<?php
$srcRoot = realpath(__DIR__."/vendor/swiftmailer/swiftmailer/lib");
$buildRoot = realpath(__DIR__);
$iterator = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($srcRoot, FilesystemIterator::SKIP_DOTS), RecursiveIteratorIterator::LEAVES_ONLY);
echo "Build SwiftMailer phar\n";
$phar = new Phar($buildRoot.'/swiftmailer.phar', 0, 'swiftmailer.phar');
$phar->buildFromIterator($iterator, $srcRoot);
@spekkionu
spekkionu / autoload.php
Created February 3, 2014 21:05
Build Zend Framework 1.x as phar
<?php
require('Zend'.DIRECTORY_SEPARATOR.'Loader'.DIRECTORY_SEPARATOR.'AutoloaderFactory.php');
Zend_Loader_AutoloaderFactory::factory(array(
'Zend_Loader_StandardAutoloader' => array(
'prefixes' => array(
'Zend' => 'Zend'
)
)
@spekkionu
spekkionu / designer.html
Created September 3, 2014 16:01
designer
<link rel="import" href="../polymer/polymer.html">
<polymer-element name="my-element">
<template>
<style>
:host {
position: absolute;
width: 100%;
height: 100%;
@spekkionu
spekkionu / 0_reuse_code.js
Last active August 29, 2015 14:06
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@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 / SymfonySession.php
Created October 9, 2014 21:41
Symfony HttpFoundation Zend\Authentication\Storage adapter
<?php
namespace Spekkionu\Zend\Authentication\Storage;
use Zend\Authentication\Storage\StorageInterface;
use Symfony\Component\HttpFoundation\Session\Session;
class SymfonySession implements StorageInterface
{
/**
* Default session namespace