Skip to content

Instantly share code, notes, and snippets.

View SteefH's full-sized avatar

Stefan van der Haven SteefH

View GitHub Profile
@SteefH
SteefH / graphviz-digraph-to-mermaid-flowchart.rb
Last active May 8, 2023 08:09
Silly conversion script: graphviz-digraph-to-mermaid-flowchart.rb
#!/usr/bin/env ruby
nodes = {}
edges = Hash.new { |hash, key| hash[key] = [] }
at_end = false
ARGF.map(&:strip).reject(&:empty?).each_with_index do |line, index|
case [index, line]
in 0, /digraph\s*\{/
in 1.., '}'
@SteefH
SteefH / Join conditions breakdown.txt
Created December 20, 2019 12:53
Join conditions breakdown
given
STATEMENTS:
ID | REVIEW_ID | BANK_STATEMENT_DOCUMENT_ID
---|-----------|---------------------------
6 | 8 | 138
7 | 9 | 137
DOCUMENTS
d.ID | d.DOCUMENTABLE_TYPE | d.DOCUMENTABLE_ID
@SteefH
SteefH / 0 - blog.md
Last active May 11, 2019 05:24
Amorphous: Writing a Scala library for boilerplate-free object mapping

Amorphous: Writing a Scala library for boilerplate-free object mapping

At Infi, we started our first Scala project (link in Dutch) in mid-2016. When it became clear that Scala might be one of the technologies used in the project, I jumped at the chance to be part of it, because I'm always eager to learn new tech, and doing a project in a functional programming language was already near the top of my professional wish list.

As always when learning new technology, I like to push the envelope to see where things start to break down. I think that's a nice way to get to know the limits of that technology. As it turns out, Scala is a powerful language, with a strong type system that lets you use many advanced concepts I won't detail here (eg. type classes, high-level abstractions like the ones in the Typeclassopedia with the help of scalaz or [Cats](https://github.com

DECLARE @DRY_RUN INT = 1
-- Triggers
DECLARE @TRIGGERS_SQL VARCHAR(MAX) = (
SELECT
'DROP TRIGGER [' + SCHEMA_NAME(so.uid) + '].[' + [so].[name] + '] '
FROM sysobjects AS [so]
INNER JOIN sysobjects AS so2 ON so.parent_obj = so2.Id
WHERE [so].[type] = 'TR'
AND [so].name LIKE '%_dss_%_trigger'