Skip to content

Instantly share code, notes, and snippets.

View chadfennell's full-sized avatar

Chad M Fennell chadfennell

View GitHub Profile
# Basic settings
set -g base-index 1
setw -g pane-base-index 1
set -g default-shell /usr/bin/zsh
set -g history-limit 2000
set -g mouse off
set -g status on
# Status bar colors
set -g status-style bg=green,fg=black
@chadfennell
chadfennell / hydrate-local.sh
Created February 3, 2026 13:56
1Password Hydration
#!/bin/sh
## 1Password CLI: https://developer.1password.com/docs/cli/
## per-env vaults e.g.
# my-proj-local
# my-proj-stage
# my-proj-prod
export OP_ACCOUNT="a-company-name-here.1password.com"
$(op signin);
@chadfennell
chadfennell / gist:b875dfb4046c7908dfdde8a22690db8d
Last active November 3, 2025 20:06
fly-secrets-hydrate.sh
#!/usr/bin/env bash
set -euo pipefail
# Sync secrets from 1Password to Fly.io
# Usage: ./fly-secrets-hydrate.sh <prod|stage>
# Pre-requisites:
# flyctl https://fly.io/docs/flyctl/install/
# 1Password op https://developer.1password.com/docs/cli/get-started/
@chadfennell
chadfennell / awesome_python.md
Created August 26, 2025 16:56
Awesome (looking) Python Libraries

Result (monad)

https://pypi.org/project/result/

from result import Ok, Err, Result, is_ok, is_err

def get_user_by_email(email: str) -> Result[User, str]:
    """
    Return the user instance or an error message.
@chadfennell
chadfennell / navbar.ex
Last active June 17, 2025 23:50
Simple CVA Navbar Example with Elixir Phoenix Daisy UI bgs
defmodule YourAppWeb.Components.Navbar do
use Phoenix.Component
use CVA.Component
variant(
:size,
[
xs: "h-10 w-full mb-3",
sm: "h-12 w-full mb-6",
md: "h-14 w-full mb-8",
@chadfennell
chadfennell / parsie.ex
Last active June 28, 2024 16:17
From: Saša Jurić - Parsing from first principles - WebCamp Zagreb 2019
defmodule Parsie do
@moduledoc """
From this talk: https://www.youtube.com/watch?v=xNzoerDljjo
"""
def run do
input = "select col1 from (
select col2, col3 from
(
select foo from some_table
@chadfennell
chadfennell / load_env.sh
Created December 9, 2021 19:07
Load ENV Variables from 1Password
#!/bin/bash
# 1) Create a Secure Note
# 2) Add a section titled "ENV" (or pick your own title but adjust the script below)
# 3) Add a Password Field (repeat this as many times as you like)
# 4) Replace "password" with your export field name (e.g. AWS_S3_KEY_ID)
# 5) Set the value of the field (e.g. the actual AWS key id)
# 6) tag the item with "exports" (or pick your own tag but adjust the script below)

Keybase proof

I hereby claim:

  • I am chadfennell on github.
  • I am chadfennell (https://keybase.io/chadfennell) on keybase.
  • I have a public key ASDcBg3epvKxMuU6AGCReOMd96A4oXZhfjVoxtedjhN4Wgo

To claim this, I am signing this object:

module MyForwardable
def def_delegator(obj, method)
define_method(method) do
self.public_send(obj).public_send(method)
end
end
end
class Dog
def speak
@chadfennell
chadfennell / mpr-mappings.json
Created July 27, 2017 15:51
ETL Hub Mappings for MPR
{
"dataProvider": {
"origins": [
{
"value": "Minnesota Public Radio"
}
]
},
"format": {
"origins": [