Skip to content

Instantly share code, notes, and snippets.

@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) {
@joshuap
joshuap / gist:5c0b3c6cb0bfb150cef3caf98cf9c6f6
Created April 4, 2019 22:08
Report correct controller name and action to Honeybadger w/ custom Rails exceptions app
Honeybadger.configure do |config|
config.before_notify do |notice|
# break out of our hook if component is not our errors controller
break if notice.component != 'errors'
# correct the component and action info based on the url
params = Rails.application.routes.recognize_path(notice.url)
# => {:controller=>"page", :action=>"index"}
notice.controller = params[:controller]
notice.action = params[:action]