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 / 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>
@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 / 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 / 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 / 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 / composer.json
Created December 1, 2015 14:39
composer.json autoload conflicts?
{
"autoload": {
"classmap": ["ToolkitApi/"],
"psr-4": {
"ToolkitApi\\":"ToolkitApi",
}
},
"autoload-dev": {
"psr-4": {
"ToolkitApiTest\\":"tests/ToolkitApiTest"
#!/bin/sh
# ################################################
rpm_rte="rpm.rte"
rpm_wget="wget-1.9.1-1.aix5.1.ppc.rpm"
# ################################################
# Setup rpm and wget
# ################################################
function setup_rpm {
rm /usr/bin/rpm
if ! test -e "/QOpenSys/download/$rpm_rte"; then
@chukShirley
chukShirley / FileStreamer.php
Created February 15, 2016 20:06
MVC Stream an image
<?php
class FileStreamer
{
public function send($file, $dest = STDOUT)
{
$fh = fopen($file, 'rb');
while (! feof($fh)) {
$data = fread($fh, 8192);
fwrite($dest, $data);
}
@chukShirley
chukShirley / MemberController.php
Last active February 26, 2016 21:59
DDD sample
<?php
class MemberController
{
private $memberService;
public function __construct(MemberService $memberService)
{
$this->memberService = $memberService;
}
<?php
namespace Temp;
use ToolkitApi\Toolkit;
class Dummy
{
/** @var Toolkit */
private $ibmiToolkit;