Skip to content

Instantly share code, notes, and snippets.

View sbchapin's full-sized avatar

Sam Chapin sbchapin

View GitHub Profile
@sbchapin
sbchapin / big_decimal_to_hexadecimal.sql
Last active April 10, 2025 22:54
hex function accepting decimal(38,0) in pure Spark SQL - supporting hex conversion for whole numbers between 0 and 99,999,999,999,999,999,999,999,999,999,999,999,999
with
-- Establish some test cases with expected outputs.
-- Note that this is the extent of the testing.
-- No claims are made to complete correctness for the full range of numbers - only for the following tests is it guaranteed.
test_cases as (
select
num,
description,
expected_output
@sbchapin
sbchapin / semantic-release-git-strategies.md
Last active August 10, 2023 01:02
Semantic release examples

Trunk-based

Given a main branch used in a trunk-based development strategy, here is how semantic release can fit in:

%%{init: { 
    'logLevel': 'debug',
    'theme': 'default' , 
    'themeVariables': {
        'git0': '#777',
@sbchapin
sbchapin / .scalafmt.conf
Created October 6, 2022 16:20
Sam's default .scalafmt.conf
# VSCode: use the Metals BSP plugin to integrate - https://marketplace.visualstudio.com/items?itemName=scalameta.metals
# IntelliJ: use the built-in support with scalafmt - https://www.jetbrains.com/help/idea/work-with-scala-formatter.html
# Required:
version = "3.5.3"
runner.dialect = scala213
# Optional:
style = defaultWithAlign # Align pattern matching statements, variable decls, function defs, adjacent symbols, etc...
maxColumn = 120 # Monitors of the 20th century rejoice