Skip to content

Instantly share code, notes, and snippets.

View seanbamforth's full-sized avatar

Sean Bamforth seanbamforth

View GitHub Profile
@seanbamforth
seanbamforth / VDFFind.pkg
Created July 20, 2012 09:09
Override Find Logic with Visual Dataflex DataDictionaries
// Used to perform any After Find logic.
Procedure mAfter_Find
Send OnChange of grpStage
End_Procedure
// Augmented to implement mAfter_Find.
Procedure Request_Find Integer eFindMode Integer iFile Integer
iIndex
@seanbamforth
seanbamforth / crafts_engineer.md
Created August 3, 2012 09:10
Craftsperson or Engineer? Maybe neither.
@seanbamforth
seanbamforth / install.sh
Created September 19, 2012 14:59
Install what's needed into ubuntu
#!/usr/bin/env bash
apt-get -y update
apt-get -y install build-essential zlib1g-dev libssl-dev libreadline5-dev libyaml-dev
cd /tmp
wget ftp://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p125.tar.gz
tar -xvzf ruby-1.9.3-p125.tar.gz
cd ruby-1.9.3-p125/
./configure --prefix=/usr/local
make
make install
@seanbamforth
seanbamforth / govern.md
Last active December 16, 2015 18:20
Thoughts on Agile in Government Projects.

Some random thoughts on using Agile in Government Projects.

Safety

I believe that Agile is just as safe as Waterfall. Nuclear Reactors, etc may use Waterfall methodologies, but it's Formal methods that make them safe. You'd think Waterfall would be safer for development because everything is always having to be signed off, but really - it's not. BTW - Formal methods are hideously expensive and are probably overkill for this type of project.

@seanbamforth
seanbamforth / oTestSave
Last active December 22, 2015 13:59
Visual Dataflex - Example of Parent Child Saving using Business Processes.
Object oTestSave is a BusinessProcess
Object oVendor_DD is a Vendor_DataDictionary
End_Object
Object oInvt_DD is a Invt_DataDictionary
Set DDO_Server to oVendor_DD
End_Object
Object oCustomer_DD is a Customer_DataDictionary
Send DefineAllExtendedFields
Struct tIndexFinder
Integer iFile
Integer iField
Integer iIndex
String sColumn
End_Struct
Object oIndexID is a cObject
Property tIndexFinder[] pIndexFinderList
Property tIndexFinder pLastItem
@seanbamforth
seanbamforth / oadate.php
Created September 24, 2013 10:21
PHP OADate formatting - To and From...
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
if ( ! function_exists('toOADate'))
{
function toOADate($timestamp) {
$from_date = new DateTime("1899-12-30");
$to_date = new DateTime($timestamp);
$interval = $from_date->diff($to_date);
return $interval -> days;
@seanbamforth
seanbamforth / ParseJson.pkg
Created February 17, 2014 11:27
Pure VDF JSON Parser
//*****************************************************************************
//*** json.pkg ***
//*** ***
//*** Author: Sean Bamforth ***
//*** SELECT Computer Systems Ltd ***
//*** April / May 2011 ***
//*** ***
//*** Purpose: ***
//*** JSON Client interface for talking to JSON / restful services. ***
//*** ***
@seanbamforth
seanbamforth / emailLibrary.pkg
Created February 22, 2014 11:29
Using the SELECT email Libraries.
Use Windows
Use cSelectMailer.pkg
Use emailAudit.pkg
//register a new SELECT emailer. This knows how to send emails.
//But we also need to tell it how to audit those emails and read system flags.
Object oChilkatMailer is a cSELECTMailer
//ghEmailObject is a global variable for your convenience. It's used as a bridge between
//global emailing functions and the emailing option.
@seanbamforth
seanbamforth / AmazonEtagHashForFile.ps1
Last active September 21, 2023 13:48
Calculate Amazon eTag hash for named file. Powershell
#Calculates an eTag for a local file that should match the S3 eTag of the uploaded file.
$md5 = new-object -TypeName System.Security.Cryptography.MD5CryptoServiceProvider
$blocksize = (1024*1024*5)
$startblocks = (1024*1024*16)
function AmazonEtagHashForFile($filename) {
$lines = 0
[byte[]] $binHash = @()