Skip to content

Instantly share code, notes, and snippets.

View dkam's full-sized avatar

Dan Milne dkam

View GitHub Profile
@dkam
dkam / transcript.md
Last active October 27, 2025 09:30
GLM 4.6 resolve some Spat / Sentry issues

#Earlier we had added better exception handling to Redis connections, so that if Redis dropped a connection, #Booko continues to work

Great! Can you list the issue on Splat-production for Booko - there are a bunch of connection timed out - I think they're all Redis? Can you check and resolve them if so?

⏺ splat-production - list_recent_issues (MCP)(status: "open", limit: 20) ⎿  ## Recent Issues

Showing 20 issue(s):

@dkam
dkam / gist:6d0767d04809faa79af409f22621ca56
Created October 21, 2025 22:34
Unreal Nobody's Girl
Unreal "Nobody's Girl" books
9798262676095 - VIRGINIA ROBERTS GIUFFRE NEW MEMOIR: Nobody’s Girl – Virginia Giuffre Story of Childhood Trauma, Survival, Justice, and Hope for Healing | WORTHINGTON, ISABELLA H. | 2025-08-28
asnB0FPBW5TPF - VIRGINIA ROBERTS GIUFFRE A NEW MEMOIR: Nobody's Girl - Virginia Giuffre: A Journey Through Childhood Trauma to Justice and Healing | ROWAN, J. T. | 2025-08-30
9798263561222 - VIRGINIA ROBERTS GIUFFRE AND THE NOBODY’S GIRL STORY FOR JUSTICE: The Girl Who Escaped the Shadows – A Biography of a Survivor Who Refused Silence and Spoke Out | THORNTON, ISLA C. | 2025-09-02
asnB0FPDM4R35 - Virginia Robert Giuffre Nobody’s Girl: A Memoir of Surviving Abuse and Fighting for Justice | Amelia Grant | 2025-08-31
asnB0FPDG6D5H - Biography of Virginia Roberts Giuffre: Nobody’s Girl – A True Story of Survival, Childhood Trauma, Justice, and Hope for Survivors of Abuse | Evelyn Hart | 2025-08-31
9798263002237 - The Untold Story of Virginia Roberts Giuffre Nobody's Girl: A powerful memoir of
@dkam
dkam / gist:5b8a4b3625e9dca9512736605f62f869
Last active October 21, 2025 10:53
Claude fixes an issue via
# NOTE: `splat-production` is an MCP endpoint which runs on my MCP compatible Sentry clone, `Splat`.
# I'd just received an email that Issue #5 had been opened. Here's Claude using the Exception
# stack trace from Splat, then creating an issue to track what we did on Gitea via their MCP.
#
# The lines begining with > are me talking to Claude
▐▛███▜▌ Claude Code v2.0.24
▝▜█████▛▘ Sonnet 4.5 · Claude Pro
▘▘ ▝▝ /Users/dkam/Development/booko
@dkam
dkam / gist:fdfbc8cdc3ca924796b85a8d5492e71d
Created October 21, 2025 10:01
GLM 4.6 adds resolve / ignore / open to Splat's MCP
> Can the MCP endpoint mark a Issue as resolved / ignored / open?
⏺ Looking at the current MCP implementation in Splat, the MCP endpoint only provides read-only access to error
tracking and performance data. The available tools are:
1. list_recent_issues - List recent issues
2. search_issues - Search issues
3. get_issue - Get detailed issue information
4. get_issue_events - List recent events for an issue
5. get_event - Get full event details
@dkam
dkam / sqlite_search.rb
Last active February 7, 2025 02:20
SQLite Search module
##
# From Mario Alberto Chavez's blog post: https://dev.to/mario_chavez/full-text-search-with-sqlite-and-rails-1cp0
##
module SqliteSearch
extend ActiveSupport::Concern
private def update_search_index
primary_key = self.class.primary_key
table_name = self.class.table_name
@dkam
dkam / uniquify_array.rb
Last active January 20, 2025 11:42
Uniquify Array
# Make an array of hashes contain a unique value for key:
def uniquify_array(array, key)
array.group_by { |item| item[key] }.map do |_, items|
(items.length > 1) ? yield(items) : items.first
end
end
# new_array = uniquify_array(array, :some_key) do |dupes|
# dupes.max_by { |item| item[:updated_at] }
remote_transmitter:
pin: GPIO5
# RF uses a 100% carrier signal
carrier_duty_percent: 100%
button:
- platform: template
name: Light Off Raw
on_press:
- remote_transmitter.transmit_raw:
{
"requests": [{
"to": "\/dsiot\/edge.adp_i?filter=pv,md",
"op": 2
}, {
"op": 2,
"to": "\/dsiot\/edge.adp_d?filter=pv,md"
}, {
"to": "\/dsiot\/edge.adp_f?filter=pv,md",
"op": 2
@dkam
dkam / gist:75b750796faf8dd42af1d5fcccc65544
Last active July 10, 2024 06:40
Kamal Ruby onRails deployment errors
INFO [40a72eff] Finished in 1.109 seconds with exit status 0 (successful).
 ERROR /usr/local/bundle/ruby/3.3.0/gems/bootsnap-1.18.3/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30: warning: /usr/local/lib/ruby/3.3.0/csv.rb was loaded from the standard library, but will no longer be part of the default gems since Ruby 3.4.0. Add csv to your Gemfile or gemspec.
WARNING:  you don't own a lock of type ExclusiveLock
bin/rails aborted!
ActiveRecord::ConcurrentMigrationError:  (ActiveRecord::ConcurrentMigrationError)

Failed to release advisory lock

#!/usr/bin/ruby
require 'rubygems'
require 'nokogiri'
XSL = <<-EOXSL
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" encoding="ISO-8859-1"/>
<xsl:param name="indent-increment" select="' '"/>
<xsl:template name="newline">