Skip to content

Instantly share code, notes, and snippets.

View darksinge's full-sized avatar

Craig Blackburn darksinge

View GitHub Profile
@darksinge
darksinge / lua.lua
Created April 6, 2023 22:01
Filetype detection: add "print statement" shortcuts to which-key (tailored for LunarVim)
local wk_ok, wk = pcall(require, "which-key")
if not wk_ok then
return
end
local vopts = lvim.builtin.which_key.vopts
local opts = lvim.builtin.which_key.opts
local mappings = {
["z"] = {
@darksinge
darksinge / Custom SST Auth Adapter.md
Last active July 17, 2024 05:03
Custom SST Auth Adapter

First, the Auth construct adds an /auth route to the API.

const auth = new Auth(stack, 'auth', {
  authenticator: {
    handler: 'auth.handler',
  },
});

const api = new Api(stack, 'api', {
@darksinge
darksinge / find-lambda.sh
Last active September 18, 2024 15:13
A script to look up lambda functions belonging to a Cloudformation stack and open it in a browser window.
#!/usr/bin/env bash
set -e
export DEBUG=0
export AWS_REGION="us-east-1"
function debug() {
if [ $DEBUG -eq 1 ]; then
echo "ERROR: $@" >&2
set fstate "$HOME/.local/state/tmp-stack.json"
# See: https://gist.github.com/darksinge/6818cb16c1b76a7a440f12dc03c283cd
source "$HOME/.config/fish/functions/gumlog.fish"
function fee
if test (count $argv) -eq 0
__fee_push
return 0
end
@darksinge
darksinge / gumlog.fish
Created May 1, 2025 22:34
Simple fish script with "logging" functions with `gum`
function on_error --on-event fish_command_error
exit
end
set -l ORANGE "#F4AC45"
set -l GREEN "#04B575"
set -l PINK 212
set -l GREY 250
function _log