Skip to content

Instantly share code, notes, and snippets.

@joshuap
joshuap / rails-debugger.agent.md
Last active December 15, 2025 22:40
Custom GitHub Copilot agent for fixing Rails errors with Honeybadger

Put this in .github-private/agents/rails-debugger.agent.md

Then add the secrets to your repositories as described here:

Honeybadger MCP Server docs:

name: Rails Debugger description: "Ruby on Rails debugging specialist with production error monitoring integration. Leverages Honeybadger MCP server to fetch real-time error data, stack traces, affected users, and occurrence patterns. Diagnoses root causes, implements idiomatic fixes, and adds regression tests following Rails conventions." tools: ['*'] mcp-servers:

@joshuap
joshuap / fetch-list-dids
Last active November 23, 2024 20:09
Get the Bluesky DIDs for all members of a list.
#!/usr/bin/env bash
# Dependencies:
# https://github.com/myConsciousness/atproto.dart/tree/main/packages/bluesky_cli
# https://github.com/jqlang/jq
# Check if URI argument is provided
if [ $# -lt 1 ]; then
echo "Usage: $0 <list-uri> [output-file]"
exit 1
@joshuap
joshuap / honeybadger.rb
Created June 29, 2024 17:00
Ignore Solid Queue SQL queries in the honeybadger gem
# config/initializers/honeybadger.rb
Honeybadger.configure do |config|
config.before_event do |event|
if event.event_type == "sql.active_record" && (event[:query] == "BEGIN" || event[:query] == "COMMIT" || event[:query]&.index("solid_queue"))
event.halt!
end
end
end
@joshuap
joshuap / openpgp.md
Created December 2, 2022 19:24
keyoxide proof

openpgp4fpr:4E5DC0D7B51CF6AB3664FCD83C185ED56E760F73

@joshuap
joshuap / app.js
Created December 10, 2020 18:24
Koa middleware for Honeybadger
// https://github.com/honeybadger-io/honeybadger-node
// https://github.com/koajs/koa/blob/master/docs/guide.md
// https://github.com/koajs/koa/blob/master/docs/error-handling.md
const Honeybadger = require('honeybadger')
const Koa = require('koa')
const app = new Koa()
// Should probably be the first middleware you use
app.use(async (ctx, next) => {
<!-- Do Not Track -->
<script type="text/javascript">
// Global
window.trackingEnabled = function() {
var dnt = navigator.doNotTrack || window.doNotTrack || navigator.msDoNotTrack;
return !(dnt === "1" || dnt === "yes");
}();
</script>
<!-- Google Tag Manager, Segment, etc. -->
@joshuap
joshuap / rails_lamby_notes.md
Last active February 21, 2022 09:00
Deploy a new Rails app to AWS Lambda using Lamby
@joshuap
joshuap / jumpstart_heya.md
Last active December 9, 2021 15:50
Configuring Jumpstart to send a welcome sequence w/ Heya
package main
import "errors"
import "fmt"
import "github.com/honeybadger-io/honeybadger-go"
func notifyHoneybadger(err error) {
if err == nil {
return
}
@joshuap
joshuap / tag.js
Created August 5, 2019 21:21
Netlify function to tag subscribers in ConvertKit
// Netlify function to tag subscribers in ConvertKit
// https://www.netlify.com/products/functions/
// POST to /.netlify/functions/tag?id={subscriberId} with JSON array of tag ids: `[{tagId}, {tagId}, ...]`
const request = require("request-promise");
const apiKey = process.env.CONVERTKIT_API_KEY;
const apiSecret = process.env.CONVERTKIT_API_SECRET;
exports.handler = function(event, context, callback) {