Skip to content

Instantly share code, notes, and snippets.

View jghankins's full-sized avatar
🏠
Working from home

Jim Hankins jghankins

🏠
Working from home
View GitHub Profile
@jghankins
jghankins / simple_s3_upload.ex
Created June 6, 2025 00:45 — forked from plicjo/simple_s3_upload.ex
LiveView Uploads to S3
defmodule SimpleS3Upload do
@moduledoc """
Dependency-free S3 Form Upload using HTTP POST sigv4
https://docs.aws.amazon.com/AmazonS3/latest/API/sigv4-post-example.html
"""
@doc """
Signs a form upload.
The configuration is a map which must contain the following keys:
* `:region` - The AWS region, such as "us-east-1"
@jghankins
jghankins / CountryCodes.json
Created December 28, 2023 15:19 — forked from anubhavshrimal/CountryCodes.json
Country and Dial or Phone codes in JSON format
[
{
"name": "Afghanistan",
"dial_code": "+93",
"code": "AF"
},
{
"name": "Aland Islands",
"dial_code": "+358",
"code": "AX"
@jghankins
jghankins / iterm
Last active September 10, 2019 09:56 — forked from vyder/iterm
iterm.bash - Launch iTerm from command line
#!/bin/zsh
#
# Open new iTerm window from the command line using v3 syntax for applescript as needed in iTerm2 Version 3+
# This script blocks until the cmd is executed in the new iTerm2 window. It then leaves the window open.
# TODO Add option to close iTerm2 after cmd execs
# See also https://www.iterm2.com/documentation-scripting.html
#
# Usage:
# iterm Opens the current directory in a new iTerm window
# iterm [PATH] Open PATH in a new iTerm window
@jghankins
jghankins / kill-rmq-connections.sh
Created February 11, 2017 18:42 — forked from thiagooak/kill-rmq-connections.sh
kill ALL rabbitmq connections
rabbitmqctl list_connections pid port state user vhost recv_cnt send_cnt send_pend name | awk '{print "rabbitmqctl close_connection \"" $1 "\" \"manually closing idle connection\"" | "/bin/bash" }'