Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View jonbartlett's full-sized avatar

Jon Bartlett jonbartlett

  • Victoria, Australia
View GitHub Profile
@jonbartlett
jonbartlett / db2-proc-export.sql
Created October 24, 2016 22:41
Export DB2 Stored Procedures to a file. Useful for comparing stored procs in the DB and those in source control as IDE's tend to try and format the code.
EXPORT TO proc_export.txt OF DEL
MODIFIED BY NOCHARDEL lobsinfile lobsinsepfiles
SELECT TEXT
FROM SYSCAT.ROUTINES
WHERE TRIM(ROUTINESCHEMA) ='RDS'
AND ROUTINENAME ='IU_RDS_CLASS';
@jonbartlett
jonbartlett / check_multi_byte_chars.sql
Created October 27, 2016 02:42
Trawl through an Oracle database for multi-byte characters
set serveroutput on;
DECLARE
sql_stmt VARCHAR2(32000);
char_cols_found boolean := false;
table_name varchar2(100);
row_count number;
PROCEDURE log (msg_txt in VARCHAR2)
@jonbartlett
jonbartlett / Gemfile
Last active January 10, 2017 23:04
Auto DB2 Proc Compilation with Ruby Guard
source 'https://rubygems.org'
group :development do
gem 'guard'
gem 'guard-shell'
end
@jonbartlett
jonbartlett / notify
Last active May 7, 2018 00:21
Notification script
#!/bin/bash
# Send a tmux, desktop, and audio notification after the completion
# of the given command when using tmux.
#
# Requires: tmux
# Recommended: espeak, libnotify
#
# modified version of https://gist.github.com/thewtex/4969741
#
@jonbartlett
jonbartlett / ScanOCR.md
Last active May 28, 2018 00:42
Scan and OCR Solution

What you'll need:

Solution:

  • EPSON Connect Cloud Scan setup to scan to PDF and place file in a Dropbox folder
  • Automator script to watch "Inbox" and invoke OCR Kit with "Run Shell Script" (set "Pass Input" = "as arguments")
now=$(date +"%Y%m%d")
@jonbartlett
jonbartlett / related_records.apex
Created December 11, 2022 22:36
SFDC - Find related records
@jonbartlett
jonbartlett / db2_alter_tb_idempotent.ddl
Last active May 2, 2023 14:34
Create a DB2 Table in an idempotent manner
--
-- db2 -td@ -vf db2_alter_tb_idempotent.ddl
--
BEGIN
IF (EXISTS (SELECT 1
FROM SYSCAT.TABLES
WHERE TRIM(TABSCHEMA)||'.'||TRIM(TABNAME) = 'TEMP.TRANSACTIONS'))
THEN
--