Skip to content

Instantly share code, notes, and snippets.

View skwashd's full-sized avatar
👨‍💻
planning, coding, reviewing

Dave Hall skwashd

👨‍💻
planning, coding, reviewing
View GitHub Profile
@skwashd
skwashd / configure-dependabot.py
Created August 27, 2019 03:50
Batch create dependabot config.yml file in github repos
#!/usr/bin/env python3
import base64
import os
import requests
token = os.environ.get("GITHUB_TOKEN")
org = os.environ.get("GITHUB_ORG")
@skwashd
skwashd / .gitconfig
Created October 3, 2021 04:31
My gitconfig
[user]
name = Dave Hall
email = [email protected]
signingkey = GPG-KEY-FINGERPRINT # follow these instructions to setup https://andrewmatveychuk.com/how-to-sign-you-commits-with-gpg-git-and-yubikey/
[core]
editor = vim # no debate
excludesfile = ~/.gitignore_global # Generated using https://www.gitignore.io/api/diff,patch,go,vim,macos,python,pycharm,webstorm,archives,phpstorm,drupal,node
[commit]
@skwashd
skwashd / autoscroll.js
Created November 12, 2023 04:03
Safari doesn't support the behaviour property when calling window.scroll. This prevents smooth scrolling. Copy and paste this code into your JS console to get smooth scrolling. Great for screen capture videos.
const footerHeight = 800;
let pos = 0,
pageHeight = document.body.offsetHeight,
winHeight = window.innerHeight,
maxPos = pageHeight - winHeight - footerHeight;
function scrollWin() {
if (pos >= maxPos) {
console.log(`We're done at ${pos}`);
@skwashd
skwashd / bricklink.py
Created February 24, 2024 09:52
Script for turning a list of LEGO entityIDs into a BrickLink wishlist
@skwashd
skwashd / README.md
Created November 3, 2024 09:06
Archive Replayed EventBridge Events

EventBridge Event Replay Module

Amazon EventBridge Archive ignores replayed events. The archive rule is a managed rule and so there is no way to remove this restriction. This limitation can be frustrating when standing up a new bus.

This Terraform module configures an AWS Step Functions Express workflow that handles replayed events from an EventBridge bus. Events with a replay-name property are sent directly to the workflow and reinjected into the same bus with the replay marker removed.

Flow

  1. EventBridge rule captures events with replay-name property
  2. Events are routed directly to a Step Function
@skwashd
skwashd / README.md
Last active January 13, 2025 16:30
Import Data from JSON File to Aurora PostgreSQL

Import Data from JSON File to Aurora PostgreSQL

This script loads data from a PostreSQL JSON dump file into an Aurora PostgreSQL database using the RDS Data API.

Update the values in the COLUMN_TYPES dictionary to match your schema. Map your column data types to the supported field types. You can cast a string to a custom type by appending :type to the field type.

Run Script

To run the script you need boto3 installed. Then run the script like so: