Skip to content

Instantly share code, notes, and snippets.

View seanmorton's full-sized avatar

Sean Morton seanmorton

  • San Francisco, CA
View GitHub Profile

Keybase proof

I hereby claim:

  • I am seanmorton on github.
  • I am seanmorton (https://keybase.io/seanmorton) on keybase.
  • I have a public key ASBNTFoEstygNRkQbV2lVCKKWeijEc2wFUikdIEOetm3HAo

To claim this, I am signing this object:

@seanmorton
seanmorton / json_to_csv.rb
Last active November 28, 2018 21:43
JSON to CSV ruby script
require 'json'
require 'csv'
def json_to_csv(json)
header = %w[key value]
data = JSON.parse(json)
csv = CSV.generate do |csv_body|
csv_body << header
data.each do |k, v|
@seanmorton
seanmorton / csv_to_json.rb
Created October 8, 2018 23:17
CSV to JSON ruby script
require 'json'
require 'csv'
def csv_to_json(csv)
object = {}
CSV.parse(csv, headers: true) do |row|
compound_key = row[0]
val = row[1]
key_parts = compound_key.split('.')
DEFINE QLOCAL('DEV.QUEUE.2') REPLACE
DEFINE QLOCAL('DEV.QUEUE.3') REPLACE
DEFINE QLOCAL('DEV.DEAD.LETTER.QUEUE') REPLACE
ALTER QMGR DEADQ('DEV.DEAD.LETTER.QUEUE')
DEFINE TOPIC('DEV.BASE.TOPIC') TOPICSTR('dev/') REPLACE
DEFINE AUTHINFO('DEV.AUTHINFO') AUTHTYPE(IDPWOS) CHCKCLNT(REQDADM) CHCKLOCL(OPTIONAL) ADOPTCTX(YES) REPLACE
ALTER QMGR CONNAUTH('DEV.AUTHINFO')
REFRESH SECURITY(*) TYPE(CONNAUTH)
DEFINE CHANNEL('DEV.ADMIN.SVRCONN') CHLTYPE(SVRCONN) REPLACE
DEFINE CHANNEL('DEV.APP.SVRCONN') CHLTYPE(SVRCONN) MCAUSER('app') REPLACE