Skip to content

Instantly share code, notes, and snippets.

View goetas's full-sized avatar

Asmir Mustafic goetas

View GitHub Profile
@adrienbrault
adrienbrault / sf2.php
Created September 10, 2012 14:41
sami example that includes protected/private properties/methods
<?php
use Sami\Sami;
use Sami\Version\GitVersionCollection;
use Sami\Parser\Filter\TrueFilter;
use Symfony\Component\Finder\Finder;
$iterator = Finder::create()
->files()
->name('*.php')
@Ocramius
Ocramius / LazyLoadableObject.php
Created November 8, 2012 10:30
DCOM-96 generated proxy example
<?php
/**
* @author Marco Pivetta <[email protected]>
*/
class LazyLoadableObject
{
public $publicIdentifierField;
protected $protectedIdentifierField;
@ryandotsmith
ryandotsmith / agg.sql
Created January 23, 2013 05:19
Postgres array concatenation aggregate function.
CREATE AGGREGATE array_accum (anyarray)
(
sfunc = array_cat,
stype = anyarray,
initcond = '{}'
);
@greg0ire
greg0ire / pagination.md
Last active May 20, 2018 16:42
Pagination

Pagination

Pagination is the process of dividing a long list of results into easier to consume pages. By only loading one page at a time, memory is preserved. This applies to RDBMS result sets, collections of serialized items in an API, or listings in list views of simple CRUD applications. Although the needs are often the same, many libraries define their own objects, or even use plain arrays to represent a paginated result. As a result, projects consuming these libraries often end up defining many adapters for those many libraries.

<?php
namespace GoetasWebservices\Xsd\XsdToPhp\Php;
use GoetasWebservices\Xsd\XsdToPhp\Php\Structure\PHPClass;
use GoetasWebservices\Xsd\XsdToPhp\Php\Structure\PHPProperty;
use Zend\Code\Generator\ClassGenerator;
use Zend\Code\Generator\DocBlock\Tag\VarTag;
use Zend\Code\Generator\DocBlockGenerator;
use Zend\Code\Generator\MethodGenerator;