Skip to content

Instantly share code, notes, and snippets.

@ebot
ebot / _about.md
Last active January 3, 2019 16:33
CCL Cheatsheet

CCL Cheatsheet

This gist will contain a collection of my commonly used CCL scripts.

You can run all of these by openening discern from the support folder

  1. Next, click on Discern Visual Developer
  2. Create a new blank CCL script.
  3. Copy and paste the contents of one of the scripts below into the new blank script.
#!/usr/bin/env ruby -wKU
# This script reads a list of completion times and
# figures out the latest end time for each day. It
# then averages those out by day of the week.
require 'csv'
require 'chronic'
latest = '00:00:00'
earliest = '24:00:00'
days = {}
@ebot
ebot / check_for_blocking.sql
Last active July 8, 2016 17:37
SQL Server Performance Tuning Queries
--Using sys.dm_exec_requests to find a blocking chain.....
--Here's a query that dumps the output of dm_exec_requests into a temporary table, then uses the XML PATH to transform the blocked_by list into a comma-delimited list in the row
--of the blocker. The sort order is the length of this comma-delimited list, putting the cause of a pileup right at the top.
--Doing this in a temp table was necessary because the blocking_session_id changes all the time. So keep in mind that the output of this query is several ms behind "live". But if you
--run it a few times, if there is an excessive blocker, the offending spid should be hanging out at the top and easy to see.
create table #ExecRequests (
id int IDENTITY(1,1) PRIMARY KEY
,session_id smallint not null
,request_id int
@ebot
ebot / ubuntu_bq_m10_tips.md
Last active April 26, 2016 17:31
BQ Aquaris M10 FHD 5 Ubuntu Frieza Phablet Issues/Tips

BQ Aquaris M10 FHD 5 Ubuntu Frieza Phablet Issues/Tips

Issue Resolution
Get microSD Working: Card recognized at first and was able to copy files out to it. Now its recognized, but cannot be seen in file manager and unmounting results in drive busy error.
Enable Apt-Get: http://bit.ly/1VUK2FW
Move Root Dir to SD Card: http://bit.ly/1YS3LUN
def decompress_text(file)
input_file = File.new file, 'rb'
input = input_file.read
output = Zlib::GzipReader.new( StringIO.new( input ) ).read
input_file.close
File.open( file.gsub( '.zip', '.pdf' ), 'w' ) do |f|
f << output
end
end
@ebot
ebot / parse_complex_json.exs
Last active October 7, 2015 03:34
Example that compares parsing a complex json object in go and in elixir
# { "DocVersions": {
# "1": {
# "version_date": "2015-10-06 12:00:00",
# "objects": [
# { "LogicalObjNum":1,
# "PhysicalObjNum":1,
# "FileExtension":"TIF",
# "FileFmtDesc":"TIFF Images (Black and White)"}
# ]
# }
#!/usr/bin/env ruby -wKU
results = ""
attempted = 0
extracted = 0
exported = 0
failed = 0
failed_docs = []
total_failures = []
@ebot
ebot / deleted_from_edm.sql
Last active August 29, 2015 14:16
Validation Queries
SELECT ob.DocId AS deleted_doc_id, ob.OBId AS deleted_ob_id
FROM on_base_docs AS ob
LEFT OUTER JOIN Documents AS d WITH (NOLOCK) ON ob.DocId = d.DocId
WHERE d.DocId IS NULL
#!/usr/bin/env ruby -wKU
# Convert XML to HTML
#
# Created By Ed Botzum
#
# This script uses the EDM XSL Stylesheet to convert XMLs to HTMLs.
require 'nokogiri'
require 'csv'
xsl_template = Nokogiri::XSLT(File.open('Ikm837Tran.xsl'))
@ebot
ebot / .tmux.conf
Last active August 29, 2015 14:10
My tmux configuration
# Reload the tmux session with an updated config:
# tmux source-file ~/.tmux.conf
# make tmux display things in 256 colors
set -g default-terminal "screen-256color"
# bind vim keys to resize panes
bind-key -r j resize-pane -D 5
bind-key -r k resize-pane -U 5
bind-key -r h resize-pane -L 5