Skip to content

Instantly share code, notes, and snippets.

View sbchapin's full-sized avatar

Sam Chapin sbchapin

View GitHub Profile
@sbchapin
sbchapin / Claude-Toast.ps1
Last active May 12, 2026 18:44
Get Windows notifications/toasts when Claude Code needs your input or wants to tell you something important.
<#
.SYNOPSIS
Displays a Windows Toast notification with a custom title and message.
.DESCRIPTION
This script creates and shows a Windows Toast notification using the Windows.UI.Notifications API.
It allows customization of the notification title, message, and the application ID used for the toast.
If JSON is piped into the script, the JSON values are preferred over the -Title and -Message parameters.
.PARAMETER Title
@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