Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View kingharrison's full-sized avatar
🏠
Working from home.... always

King Harrison kingharrison

🏠
Working from home.... always
View GitHub Profile
IF (NOT EXISTS(SELECT * FROM QSYS2.SYSTABLES WHERE TABLE_SCHEMA = 'BACKUP' AND TABLE_NAME='MYTABLE')) THEN
CREATE TABLE BACKUP.MYTABLE
AS (SELECT * FROM MYLIB.MYTABLE)
WITH DATA;
ELSE
INSERT INTO BACKUP.MYTABLE
SELECT * FROM MYLIB.MYTABLE;
END IF;
<?php
namespace Tablecodes\Model;
use Zend\Db\ResultSet\ResultSet;
use Zend\Db\TableGateway\TableGateway;
use Zend\Db\Sql\Select;
use Zend\Paginator\Adapter\DbSelect;
use Zend\Paginator\Paginator;
use K3sbase\Model\TABLCOD;
'service_manager' => array (
'invokables' => array (
'AuthorizationIbmi' => 'authorization.php',
'ToolkitService' => '../API/ToolkitService.php''
),
),
@kingharrison
kingharrison / gist:5b30de11e4865e995401
Created July 23, 2014 20:04
Caching Images and CSS on an IBM i running apache to speed up access
<ifModule mod_expires.c>
ExpiresActive On
ExpiresDefault "access plus 1 seconds"
ExpiresByType text/html "access plus 1 seconds"
ExpiresByType image/gif "access plus 2592000 seconds"
ExpiresByType image/jpeg "access plus 2592000 seconds"
ExpiresByType image/png "access plus 2592000 seconds"
ExpiresByType text/css "access plus 604800 seconds"
ExpiresByType text/javascript "access plus 216000 seconds"
ExpiresByType application/x-javascript "access plus 216000 seconds"
@kingharrison
kingharrison / gist:af94678a89dc5818a9c8
Last active August 29, 2015 14:04
Zf2 ZFCuser currently logged in detection and session timeout support
public function onBootstrap(MvcEvent $e) {
$eventManager = $e->getApplication ()->getEventManager ();
$sharedManager = $eventManager->getSharedManager ();
$sm = $e->getApplication ()->getServiceManager ();
// This checks to see if the user is logged in.
$eventManager->attach ( MvcEvent::EVENT_DISPATCH, array (
$this,
'checkLogin'
), 100 );
}
@kingharrison
kingharrison / gist:2c716f8758dc2be2cb06
Created July 23, 2014 17:11
Code to insert on template while creating vhost on IBM i via Zend Server so that ZF2 framework is accessible
RewriteEngine off
<Location />
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteRule ^.*$ /index.php [NC,L]
</Location>
@kingharrison
kingharrison / gist:1e3951d53d13129a3687
Last active August 29, 2015 14:04
Sample post_activate.php script that pulls user variables from install and writes out local confit files for ZF2 in a ZPK on Zend Server running on the IBM i
<?php
/*
* This is the instasll script used to setup environmental variables when first installing K3S
*/
/*
* This loads variables from the deployment script. All variables added as parameters are accessable as ZS_<PARAMETER_NAME>
*/
$appLocation = getenv ( "ZS_APPLICATION_BASE_DIR" );