Skip to content

Instantly share code, notes, and snippets.

View chukShirley's full-sized avatar

Chuk Shirley chukShirley

  • Sure Consulting LLC
  • Alabama
View GitHub Profile
@chukShirley
chukShirley / application.config.php
Created November 9, 2015 04:22
ZF2 DB2 configuration
<?php
$env = getenv('APPLICATION_ENV');
return [
// modules, module listener options, etc.
'config_glob_paths' => [
__DIR__.'/autoload/{,*.}{global,'.$env.',local}.php',
]
]l
@chukShirley
chukShirley / InvoiceNumber.php
Created November 4, 2015 22:32
PHP Value Objects
<?php
namespace My\Namespace;
final class InvoiceNumber
{
private $invoiceNumber;
private function __construct(){};
public static function fromString($string)
@chukShirley
chukShirley / 0_reuse_code.js
Created November 4, 2015 22:21
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
@chukShirley
chukShirley / IbmiToolkit_Module.php
Created September 23, 2015 20:03
ZF2 IBM i Toolkit module
<?php
namespace IbmiToolkit;
use Zend\Mvc\ModuleRouteListener;
use Zend\Mvc\MvcEvent;
class Module
{
public function onBootstrap(MvcEvent $e)
{
@chukShirley
chukShirley / phpunit.xml.dist
Created September 8, 2015 20:56
PHPUnit XML Configuration
<?xml version="1.0" encoding="UTF-8"?>
<phpunit bootstrap="../../../vendor/autoload.php"
backupGlobals="false"
backupStaticAttributes="false"
colors="true"
verbose="true">
<testsuites>
<testsuite name="loadEntry">
<sirectory suffix="Test.php">./LoadEntryTest</sirectory>
<?php
// /Module/IbmiToolkit/src/IbmiToolkit/Factory/ToolkitFactory.php
namespace IbmiToolkit\Factory;
use Zend\ServiceManager\FactoryInterface;
use Zend\ServiceManager\ServiceLocatorInterface;
/**
* Class ToolkitFactory
@chukShirley
chukShirley / PostMapper.php
Last active August 29, 2015 14:27
Persistence
<?php
class PostMapper
{
public function objectToDb(Post $post)
{
return [
'title' => $post->getTitle(),
'content' => $post->getContent()
];
}
@chukShirley
chukShirley / CustomerId.php
Created August 12, 2015 01:15
value object for unique key containing multiple columns
<?php
class CustomerId
{
private $name;
private $address;
public function __construct($name, $address)
{
$this->name = (string) $name;
LoadModule ibm_ssl_module /QSYS.LIB/QHTTPSVR.LIB/QZSRVSSL.SRVPGM
# Enable compression
LoadModule deflate_module /QSYS.LIB/QHTTPSVR.LIB/QZSRCORE.SRVPGM
# Specify content types to compress
AddOutputFilterByType DEFLATE application/x-httpd-php application/json text/css application/x-javascript application/javascript text/html
# Browser caching rules
ExpiresActive On
@chukShirley
chukShirley / db2.travis.xml
Last active August 29, 2015 14:25
Travis.xml for Doctrine (IBM DB2)
<?xml version="1.0" encoding="utf-8"?>
<phpunit bootstrap="../Doctrine/Tests/TestInit.php" colors="true">
<php>
<var name="db_type" value="ibm_db2"/>
<var name="db_host" value="myDbName" />
<var name="db_username" value="WEBTEST" />
<var name="db_password" value="WEBTEST" />
<var name="db_name" value="DCTRNTST" />
<var name="db_port" value="3306"/>