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
This file has been truncated, but you can view the full file.
Project Mode enabled: true
Starting search of: /Users/adamshirley/apps/k3s/K3S-Replenish-RPG
Found RPGLE files: 1079
Validating file from server: qrpglesrc/ar_cexcer.rpgle
Big mode detected!
Validating file from server: qrpglesrc/ar_pgmdstr.rpgle
Fetching file from server: file:///Users/adamshirley/apps/k3s/K3S-Replenish-RPG/qrpglesrc/ar_cexcer.rpgle
Fetching file from server: file:///Users/adamshirley/apps/k3s/K3S-Replenish-RPG/qrpglesrc/ar_pgmdstr.rpgle
Validating file from server: qrpglesrc/ar_oexcer.rpgle
Validating file from server: qrpglesrc/locatns_h.rpgle
@chukShirley
chukShirley / MyContext.php
Last active April 13, 2018 18:06
Behat + Mink wait for modal to be visible
class MyContext extends RawMinkContext
{
private function waitForMyModalToBeVisible()
{
$modalId = 'myModal'
$this->spin(function($context) {
return ($context->getSession()->getPage()->findById($modalId)->isVisible());
});
}
@chukShirley
chukShirley / index.html
Last active February 28, 2018 20:54
Retrieve data-* attributes from local data for option elements
<select id="mySelect2">
<option value="1" data-vendor-number="5">1: Acme Industries</option>
<option value="2" data-vendor-number="5">2: Your Company, LLC</option>
</select>
@chukShirley
chukShirley / hooklog.txt
Last active January 16, 2018 21:46
Jenkins GitHub Hook Log
Last GitHub Push
Started on Jan 16, 2018 3:39:21 PM
Started by event from 192.30.253.29 ? http://69.1.49.228:8080/github-webhook/ on Tue Jan 16 15:39:21 CST 2018
Using strategy: Default
[poll] Last Built Revision: Revision 0492067a1aabf31fe00d345dcea7d3b3c64f6cfc (refs/remotes/origin/master)
> /QOpenSys/QIBM/ProdData/OPS/tools/bin/git --version # timeout=10
using GIT_SSH to set credentials Jenkins SSH key for GitHub
> /QOpenSys/QIBM/ProdData/OPS/tools/bin/git ls-remote -h git@github.com:Sabel-Steel-Service/Metal-Center.git # timeout=10
Found 4 remote heads on git@github.com:Sabel-Steel-Service/Metal-Center.git
@chukShirley
chukShirley / STRJRNPFLIB.php
Created December 12, 2017 12:17
Start Journal Physical File for all table objects in a library
<?php
$library = 'MYLIB';
$journalLibrary = 'MYLIBJRN';
$journal = 'JRNL';
// Use DB2 for i service
$connection = db2_connect('*LOCAL', '%USER%', '%PASSWORD%');
$sql = 'SELECT * FROM QSYS2.TABLES where table_schema=? and table_type=? order by table_name asc';
$params = [$library, 'BASE TABLE'];
$statement = db2_prepare($connection, $sql);
@chukShirley
chukShirley / SearchTestReports.js
Last active June 13, 2017 14:35
Chained select boxes populated from AJAX results
var SearchTestReports = (function () {
var changeProductGroup = function (event) {
_getItemCodesByProductGroup(event.target.value).done(function (response) {
// populate item code select box
};
};
var _getItemCodesByProductGroup = function (productGroup) {
return $.ajax({

php2rpg

Guide showing you PHP and RPG differences

  • RPG is strongly typed.
  • RPG indexes start at 1, where PHP starts at 0.
  • Variables in PHP start with a Dollar sign. ($)

Typing

@chukShirley
chukShirley / index.js
Created January 18, 2017 16:02
Select2 on change event
$(document).ready(function() {
$('#mySelect2').select2({
// properties
}).on('change', function (e, added) {
// If an option has been selected
if (e.val !== '') {
}
});
});
@chukShirley
chukShirley / index.js
Created January 18, 2017 15:43
Programmatically focus on select 2
$(document).ready(function(){
$('#mySelect2').select2('open')
});
<?php
class GeneratePdfController extends AbstractActionController
{
public function indexAction()
{
$filename = '/path/to/myFile.pdf';
$response = new Stream();
$headers = new Headers();
$headers
->addHeaderLine('Pragma', 'public')